Linkin Park Posted June 21, 2012 Posted June 21, 2012 (edited) How to setup a cron job that will automate database backup every 3am and make it upload the backup file to a separate ftp server? Using CentOS. Edited June 21, 2012 by RaGERO Quote
Elijah23 Posted June 21, 2012 Posted June 21, 2012 There's a script from calciumkid that's posted in eathena.. The sad news is, eathena is down now.. Quote
Nipsino Posted June 22, 2012 Posted June 22, 2012 Use cached versions. Lol. http://webcache.googleusercontent.com/search?q=cache:wnHNV7frRq8J:www.eathena.ws/board/index.php%3Fshowtopic%3D264094+&cd=1&hl=en&ct=clnk&gl=us Quote
Asura Posted June 23, 2012 Posted June 23, 2012 Hi RaGERO, You can use this script; https://asurahosting...ols/bkup_sql.sh Just modify the values correctly, and make sure the backup directory you are saving it to... actually exists. To make a folder, you can use VNC or type the following command in the terminal... mkdir /DESTINATION/NEW_FOLDER To make the script executable, you can edit the properties in your SFTP client or do the following command in the terminal... cd /LOCATION/OF/SCRIPT chmod +x bkup_sql.sh Then finally, you need to add it to the cronjob; which would be like this... export EDITOR=/usr/bin/nano crontab -e Inside the crontab, you would need to input... 0 3 * * * /LOCATION/OF/SCRIPT/bkup_sql.sh Then just ctrl + c and save. 1 Quote
Bahmut Posted June 23, 2012 Posted June 23, 2012 Inside the crontab, you would need to input... 0 3 0 0 0 /LOCATION/OF/SCRIPT/bkup_sql.sh This gave me an error. Fixed it by using * instead of 0: 0 3 * * * /LOCATION/OF/SCRIPT/bkup_sql.sh Quote
Linkin Park Posted June 23, 2012 Author Posted June 23, 2012 @Asura, This will only save the backups on the specified directory, I want it to be uploaded on a separate ftp server. Quote
Elijah23 Posted June 23, 2012 Posted June 23, 2012 @Asura, This will only save the backups on the specified directory, I want it to be uploaded on a separate ftp server. Use Eden's post.. that's what I'm telling you about.... Quote
Asura Posted June 23, 2012 Posted June 23, 2012 This gave me an error. Fixed it by using * instead of 0: 0 3 * * * /LOCATION/OF/SCRIPT/bkup_sql.sh Hi Bahmut, You're right; my mistake. Thanks for the correction. @Asura, This will only save the backups on the specified directory, I want it to be uploaded on a separate ftp server. Hi RaGERO, If your backup server allows SSH access, you can install the cron task on there and just add the variable '-h'. mysqldump -h 123.123.123.123 -u USERNAME -p, --password=PASSWORD DATABASE_NAME > FILE_NAME.sql Replace the 123.123.123.123 with the correct MySQL Host IP; and all the capital letters with the correct information. 1 Quote
Fuyuko Posted June 23, 2012 Posted June 23, 2012 Automatic backups are best done with software like swordsky has really good software with really good options that allows you to back up really large databases and it works as a windows service. Quote
Arcana Posted June 24, 2012 Posted June 24, 2012 Automatic backups are best done with software like swordsky has really good software with really good options that allows you to back up really large databases and it works as a windows service. Thanks, I like to use windows because many korean game use it with mssql. Quote
Question
Linkin Park
How to setup a cron job that will automate database backup every 3am and make it upload the backup file to a separate ftp server?
Using CentOS.
Edited by RaGERO11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.