Graph-IT

dbbackup.php

This script creates a backup of all databases using innobackupex which is part of Perconas XtraBackup. In case of any errors an email will be send. Database credentials and the target backup folder need to be specified inside the config.ini. The date of the last successful backup will be saved into 'backupFinished.txt' inside the backup folder.

Usage:

dbbackup.php

Note: When using MYSQL 5.7+ you need a innobackupex version of xtrabackup 2.4+.

Side note: We usually use the config.ini for configuration and trigger this script daily through a crontab entry.

# dbbackup: database backup
30 03 * * * <path to dbbackup.php> >> /var/log/dbbackup.log 2>&1