Every day, Cron runs a bash script to backup the MySQL DB & Mediawiki image files to Beaker, from where we rely on Beaker's cloud backup for longer term storage.

The Script

The canonical location of the script is /root/backup.sh, there is a symlink from /etc/cron.daily/backup.sh (which is how it runs daily)

Databases

The script loops through the databases (except the system DBs 'information_schema', 'performance_schema' & 'archive'), dumps them in SQL format to a tmpfile, and then compresses that file to /mnt/beaker/IT/MySQL_Backups/[DAY OF THE WEEK]/[DATABASE].sql.bz, providing us with an automated one week backlog

Wiki Uploads

The three live wikis (Crew, Plot & Public) also have their image directories backed up to /mnt/beaker/IT/mediawiki-image-backups/ by rsync as part of the same script.

Flaws

  • Errors go to cron-mail, which I'm fairly sure is a black hole
  • Working out which is the most recent backup isn't trivial
  • Daily cron tasks happen at 17:45, which isn't a great time to slow the DB down.