![]() |
Database backup
Does anyone know how to do an automatic back up of the database for vB 5?
|
This doesn't have to be done inside of vBulletin, you can simply setup a cronjob to execute a bash file to run mysqlbackup every X hours/days to make a backup to a certain location.
Then you could even execute a tool such as zip in the bash file to zip the backup and save some storage. |
I have tried this but I dont have permission with this script. I can run just the mysqldump command manually and it works but as soon try to run the backup.sh script with the code below it says I dont have permission. Any ideas on how fix this? Thank you for your help.
#!/user/bin/sh mysqldump -u root -p pwd --opt db1.sql > /respaldosql/db1.sql |
Try chmodding the file to allow execution: chmod u+x file.sh
|
I am now getting
-bash: ./backup.sh: /user/bin/sh^M: bad interpreter: No such file or directory and with out /user -bash: ./backup.sh: /bin/sh^M: bad interpreter: No such file or directory --------------- Added [DATE]1442944340[/DATE] at [TIME]1442944340[/TIME] --------------- Let me give you the actually code that I am using. Maybe this will help. #!/bin/sh mysqldump --no-create-db=true --opt -Q -h dbxxxxxxxx.db.1and1.com -u dbxxxxxxxxx -pxxxxxx dbxxxxxxxxxx > files/jaxreef.org`date +%m%d%y%H%M`.sql find files/jaxreef* -mtime +5 -exec rm {} \; |
That happens when you create a new file on Windows, you have to open the backup.sh file in your editor and save it with "Unix" line endings.
|
Quote:
|
Dave thank you for the help. It works now. :)
|
Just in case anyone else is looking for how to do this.... I created a thread:
https://www.christforums.org/forum/e...-code-for-cron |
All times are GMT. The time now is 08:12 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|