Skip to content

Instantly share code, notes, and snippets.

@mmrwoods
Created January 20, 2012 13:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mmrwoods/1647449 to your computer and use it in GitHub Desktop.
Save mmrwoods/1647449 to your computer and use it in GitHub Desktop.
MySQL maintenance crontab file
# note: MySQL_maintenance.pl can be obtained from http://danbuettner.net/mysql-tools/
# check, optimise and repair MySQL databases (extended check on Sunday, quick every other day)
15 3 * * 0 root nice -n 19 /usr/local/sbin/MySQL_maintenance.pl --check-type=extended --optimize --repair --exclude-dbs=information_schema
15 3 * * 1-6 root nice -n 19 /usr/local/sbin/MySQL_maintenance.pl --check-type=quick --optimize --repair --exclude-dbs=information_schema > /dev/null
# dump all mysql databases once every 24 hours
15 4 * * * root nice -n 19 mysqldump --opt --all-databases --allow-keywords | gzip -9 > /var/local/backup/mysql/mysql_all.sql.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment