3 Basic Configuration
The main configuration file is /etc/mysql-zrm/mysql-zrm.conf. In this file we have to specify at least the MySQL-backup user (a MySQL user with all privileges, like root) and his password:
vi /etc/mysql-zrm/mysql-zrm.conf
user="root" password="yourrootsqlpassword" |
If nothing else is specified, mysql-zrm assumes default values for all other settings. With this configuration, mysql-zrm would do backups of all databases, in raw format, it would keep the backups forever, and it wouldn't send email notifications.
Raw format means, it backs up the databases as binary files that can be copied back to the database in case of loss of data, but it can cause problems if you copy these files between different MySQL versions.
The counterpart of the raw format is the logical format which creates text files with a plain SQL dump of your databases. These SQL dumps can be restored in almost all MySQL versions, and you could even do it manually, as shown here: https://www.howtoforge.com/faq/6_4_en.html
If you want to get email notifications to your email address example@example.com, add this to /etc/mysql-zrm/mysql-zrm.conf:
vi /etc/mysql-zrm/mysql-zrm.conf
mailto="example@example.com" |
If you want to make backups in logical format and want to keep backups for seven days (instead of forever), add these lines to /etc/mysql-zrm/mysql-zrm.conf:
vi /etc/mysql-zrm/mysql-zrm.conf
# allowed values for backup-mode are "raw" and "logical" backup-mode=logical retention-policy=7D |
If you want to make a backup of a MySQL replication slave, add this line to /etc/mysql-zrm/mysql-zrm.conf:
vi /etc/mysql-zrm/mysql-zrm.conf
replication=1 |
This will back up files that are important for a MySQL replication slave.
If you want to back up only the databases exampledb and anotherexampledb instead of all databases, add this to /etc/mysql-zrm/mysql-zrm.conf:
vi /etc/mysql-zrm/mysql-zrm.conf
databases=exampledb anotherexampledb |
If you only need backups of the tables text, user, and page from the exampledb database, add this to /etc/mysql-zrm/mysql-zrm.conf:
vi /etc/mysql-zrm/mysql-zrm.conf
tables=text user page database="exampledb" |
Please note: the settings all-databases, databases, and tables/database are mutually exclusive!
The default /etc/mysql-zrm/mysql-zrm.conf comes with lots of comments that explain all configuration options. I'm using these settings for now:
vi /etc/mysql-zrm/mysql-zrm.conf
user="root" password="yourrootsqlpassword" mailto="example@example.com" backup-mode=logical retention-policy=7D # all-databases=1 is optional, as it is the default setting all-databases=1 |