Skip to content

Instantly share code, notes, and snippets.

@alexclifford
Created January 16, 2014 00:04
Show Gist options
  • Save alexclifford/8447274 to your computer and use it in GitHub Desktop.
Save alexclifford/8447274 to your computer and use it in GitHub Desktop.
Quick and dirty MySQL server backups.
# 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