Backup

From Makespace
Jump to: navigation, search

MediaWiki

Our plan is based on http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki.

This is the shell script used to create backup files of MediaWiki's database and configuration files:

#!/bin/sh
nice -n 19 /usr/bin/mysqldump -u wikiuser wikidb -c --password=<wikiuser password> | nice -n 19 /bin/gzip -9 > ~/backup-wikidb-$(date '+%a').sql.gz
tar zcf backup-mediawiki-etc-$(date '+%a').tar.gz /etc/mediawiki

This is invoked each midnight by a crontab entry:

0 0 * * * /home/jimm/backup-mediawiki

The files backup-mediawiki-* are then copied off to a remote server by a crontab running on another machine.

Restoration plan

Not planned or tested yet.