Linkin Park Posted June 21, 2012 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 227 Reputation: 11 Joined: 11/16/11 Last Seen: November 7, 2015 Share 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 Link to comment Share on other sites More sharing options...
Elijah23 Posted June 21, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 292 Reputation: 17 Joined: 12/12/11 Last Seen: Friday at 11:44 PM Share Posted June 21, 2012 There's a script from calciumkid that's posted in eathena.. The sad news is, eathena is down now.. Quote Link to comment Share on other sites More sharing options...
Linkin Park Posted June 22, 2012 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 227 Reputation: 11 Joined: 11/16/11 Last Seen: November 7, 2015 Author Share Posted June 22, 2012 bump... Quote Link to comment Share on other sites More sharing options...
Nipsino Posted June 22, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 218 Reputation: 16 Joined: 01/24/12 Last Seen: May 24, 2015 Share 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 Link to comment Share on other sites More sharing options...
Asura Posted June 23, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 707 Reputation: 168 Joined: 01/26/12 Last Seen: February 7, 2014 Share 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 Link to comment Share on other sites More sharing options...
Bahmut Posted June 23, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 382 Reputation: 39 Joined: 01/17/12 Last Seen: February 13, 2020 Share 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 Link to comment Share on other sites More sharing options...
Linkin Park Posted June 23, 2012 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 227 Reputation: 11 Joined: 11/16/11 Last Seen: November 7, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
Elijah23 Posted June 23, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 292 Reputation: 17 Joined: 12/12/11 Last Seen: Friday at 11:44 PM Share 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 Link to comment Share on other sites More sharing options...
Asura Posted June 23, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 707 Reputation: 168 Joined: 01/26/12 Last Seen: February 7, 2014 Share 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 Link to comment Share on other sites More sharing options...
Arcana Posted June 23, 2012 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 6 Reputation: 1 Joined: 12/17/11 Last Seen: November 7, 2016 Share Posted June 23, 2012 Windows version? Quote Link to comment Share on other sites More sharing options...
Fuyuko Posted June 23, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 17 Reputation: 0 Joined: 02/10/12 Last Seen: September 3, 2012 Share 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 Link to comment Share on other sites More sharing options...
Arcana Posted June 24, 2012 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 6 Reputation: 1 Joined: 12/17/11 Last Seen: November 7, 2016 Share 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 Link to comment Share on other sites More sharing options...
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 RaGEROLink to comment
Share on other sites
11 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.