A script to create mysql backups and keep backups with a retention scheme.
It creates backups every 15 minutes and every three hours a backup with Percona XtraBackup.
- [Percona XtraBackup] (http://www.percona.com/software/percona-xtrabackup).
-
Create a .my.cnf file with mysql root credentials in /root:
[client] user = <mysql-root-user> password = <password> -
Install the script as /usr/local/sbin/backup
-
Setup a cron job:
*/15 * * * * /usr/local/sbin/backup
- 12 monthly backups are maintained
- 4 weekly backups
- 7 daily backups
- 96 backups of every 6 hours
- 48 backups of every 3 hours
- 96 quarterly backups