Server backup and restore
Contents
Strategies
Wikis: Both the media folders and mysql databases need regular backup and validation of restore. We can run a backup to a separate disk, which is mounted at /mnt/dump and mapped; with /var/backups mapped to /mnt/dump/var/backups. Thus writing a backup to /var/backups will end up on this disk.
Backup scripts are currently stored at: /var/backupscripts/
We want a combination of rsync for heavily used resources (especially the media folders or wikis, and other media storage) and versioned, 7-zipped backup (to protect against user-error as well as hardware failure). The versioning schema is planned to be 7 daily versions (cyclically overwritten), 5 weekly ones (cyclically overwritten), 12 monthly ones (cyclically overwritten), yearly ones (not overwritten). That is after the first year, one has 7 + 5 + 12 + years = 24 + yearly copies.
Versioned backup should be /etc and /home weekly, and /var (without backup, mysql db and media folders) daily.
Current MySQL backup
The daily backup of all of mysql databases is performed by the script
/var/backupscripts/mysql_bak_manol.sh
which is executed as cron job at 03:12 every night. The backup files is located in
/mnt/dump/var/backups/mysql/
and is named as:
ttYY-MM-DD_DBNAME.sql.7z
In the script there is a variable DBSKIP that contains names of databases to skip, for example:
DBSKIP="information_schema|otherdb1|otherdb2"
Current MediaWiki media folder backup
The daily backup of media wikis is performed by the script
/var/backupscripts/mediawiki_bak_manol.sh
which is executed as cron job at 03:22 every night.
It rsync files from media dirs of wikis to the corresponding subdir in/mnt/dump/var/backups/wikis/It also makes tar backup with all LocalSetting* in
/mnt/dump/var/backups/wikis/. The name of tars is:
ttYY-MM-DD_settings.tar
Remote backup
The daily remote backup of these dirs:
/mnt/dump/var/backups/wikis/ /mnt/dump/var/backups/mysql/
is performed by the script
/var/backupscripts/remote_bak_manol.sh
It is executed as cron job at 03:33 every night and make rsync of specified dirs to remote server
k2n.bikam.com