-
-
Save brunocarvalhodearaujo/d360014006ffc25bb32ac2884cca4b7d to your computer and use it in GitHub Desktop.
automated mysql dump using Linux Cron tab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mysqldump -u root -pmysql123 –all-databases –routines| gzip > /root/MySQLDB_`date ‘+%m-%d-%Y’`.sql.gz | |
mysqldump -h 172.16.21.3 -u root -pmysql123 –all-databases –routines | gzip > /root/MySQLDB.3_`date ‘+%m-%d-%Y’`.sql.gz | |
#now create cron script smth like this | |
#crontab -e | |
#30 15 * * * /root/MySQLdump.sh 2>&1>> /root/MySQLdump.log | |
#The above will dump the database every day at 15:30. | |
#http://dbperf.wordpress.com/2010/06/11/automate-mysql-dumps-using-linux-cron-job/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment