Created
January 16, 2014 00:04
-
-
Save alexclifford/8447274 to your computer and use it in GitHub Desktop.
Quick and dirty MySQL server backups.
This file contains 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
# MySQL database dumps | |
05 23 * * mon-fri root mysqldump --all-databases --events -pXXXXXXXX | gzip > /var/backup_files/mysqldumps/mysql-dbs-$(date +\%F).sql.gz | |
# Only keep the past 2 weeks of backups | |
00 23 * * * root find /var/backup_files/mysqldumps/ -mtime +14 -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment