Backup Set Parameters

From The Open Source Backup Wiki (Amanda, MySQL Backup, BackupPC)
Jump to navigationJump to search

Listed below are backup set parameters that can be specified in global and backup set specific mysql-zrm.conf configuration files. All the parameters are optional. Some of the parameters have default values.

Backup Parameters

backup-level
Backup level to be used for the backup set. It can be full (0) or incremental (1). Default is 0 (i.e. full backup).
backup-mode
Backup mode can be raw or logical. Raw backup images contain actual database whereas logical backups contains the list of SQL statements (CREATE TABLE, INSERT) needed to recreate the tables and the data in the database. Logical backup images can be easily restored to another machine with different system architecture or to different type of databases (not MySQL). This parameter is optional and default mode is raw.
backup-type
Type of backup to be performed. Values can be "regular" or "quick". Quick backup type uses the snapshot itself as the backup without copying the data from the snapshot volume. Quick backups can be converted into Regular backups. Recovery can be done from quick or regular backups.
destination
The directory location of backups for the backup set where all backups are stored. This parameter is optional and default value is /var/lib/mysql-zrm on the local machine running ZRM for MySQL. The directory should have sufficient space to store the backups, else backup run will fail. The user running ZRM for MySQL (in most cases "root" ) should have the privilege to write to the directory and create sub-directories under it.
retention-policy
Backup images will be retained for the time specified. It can be specified in days (suffix: D), weeks (suffix: W), months (suffix M) or years (suffix Y). By default, there are 30 days in a month and 365 days in a year. For example: retention-policy 10M would mean the backup images would be retained for 300 days after the backup date. This parameter is optional and by default backups are retained forever.
compress
Set this parameter to 1 to compress the backup image. The default value is 0 (no compression). ZRM for MySQL uses compression utilities that are available in the local server to do compression. The default compression program used is gzip (GNU zip utility). If a different compression program is to be used, it must be specified in compress-plugin parameter.
On the fly compression (compress-mysqldump-onthefly)
Set this parameter to 1 to compress logical backups on the fly. Otherwise, backups are written to disk and compressed.
compress-plugin
Specifies the compression program, along with its full path, to be used for compressing backup images. The compression program must be support -d option for uncompressing the backup images. This parameter is used only if compress parameter is set to 1. The parameter is optional and default compression program is gzip.
encrypt
Set this parameter to 1 if the backup images are to be encrypted. ZRM for MySQL does not provide key management. The encryption program, along with its full path, has to be specified in encrypt-plugin parameter. ZRM for MySQL uses encryption utilities that are available on the local server to do encryption. By default, backup images are not encrypted. There is no default encryption program.
encrypt-plugin
Specifies the encryption program, along with its full path, if the backup images are to be encrypted. This parameter must be specified if encrypt parameter is set to 1. The decrypt-option parameter must be also specified.
decrypt-option
This parameter is the option passed to the encryption program specified by encrypt-plugin for decrypting the backup images. The default value is -d. If the encryption program has different command or multiple options to decrypt the backup image, a command wrapper is required.
replication
Set this parameter to 1 when backing up from a MySQL replication slave. This allows all replication related files to be backed up without impacting the MySQL database server. ZRM for MySQL does not set up MySQL replication slave for backups which has to be done separately.
snapshot-plugin
Specifies the plugin to be used for snapshot operations. The default is the lvm-snapshot plugin. This value is optional and must be specified if the raw backup has to be done using snapshots. Possible values are lvm-snapshot or zfs-snapshot. Example: "/usr/share/mysql-zrm/plugins/lvm-snapshot.pl"
snapshot-size size
ZRM for MySQL can use LVM snapshots to create an internally consistent raw backup of the MySQL database. When specified LVM snapshot are used for all the MySQL databases in the backup set of a logical volume. The value of this field should be size of snapshot volume. Ensure that sufficient disk space on the machine hosting LVM databases is available to create the snapshot. Note that during the process of creating the backups the disk space may fall short. LVM stores the snapshot blocks corresponding to the blocks that are modified in the original logical volume in the snapshot volume. If the database is highly active during the backup, many blocks will be modified and snapshot volume may run out of space. Under these circumstances, the backup will not be consistent. The lvm-snapshot option has been deprecated in 2.x releases.
The size of snapshot can have size suffix k for kilobytes, m for megabytes, g for gigabytes or t for terabytes.
comment
Note about the backup. This note can be used by the database administrator to store information about the backup set. This information can be viewed as part of most reports.
tmpdir
Full path of the directory to be used for storing temporary files and directories on the backup host as well as the remote hosts. This directory should have sufficient space to hold at least one full backup on the MySQL server during backup and on the backup host during restore. If not specified it defaults to the system specified temporary directory on the backup host. For example: /tmp.
Synchronous Checksums (synchronous-checksum)
ZRM for MySQL computes checksums of the backup images during backup process. This process can take a long time for multi-terabyte backups. If synchronous checksums is to set to 0, checksums are computed asynchronously and not as part of the backup process. Disabling this option will reduce the backup window.

Databases/Tables in the Backup Set

One of the all-databases or databases or tables/database parameters should be specified. If none of them is specified, all-databases is assumed. Default is backup set that contains all databases on the MySQL server.

all-databases
This parameter should be set to 1 if all databases are to be a part of the backup set.
databases
List of databases that are part of the backup set. The database names have to be separated by space character. If all databases are part of backup set, use all-databases parameter.
database
There can be only one database name specified as value. The tables specified in tables backup parameter should belong to the database specified in this field.
tables
List of tables that are part of the backup set. These tables should belong to the database specified in database backup parameter. The table names should be separated by space character. The database backup parameter must be specified if this parameter is to be valid. ZRM for MySQL does not verify database referential integrity of the backups. Backup will fail if ZRM for MySQL does not find the specified tables in the given database.

MySQL Server Parameters

user
MySQL database user that will be used by ZRM for MySQL for connecting to the MySQL server to do backups and recovery. This user should have sufficient privileges to do backup and recovery. See MySQL backup user section for more information on granting privileges. If this field is not specified, information from MySQL client options file - my.cnf is used.
password
MySQL database password for the user specified in user backup parameter. This password has to be provided in plain text. If this field is not specified, information from MySQL client options file - my.cnf is used. Please follow instructions provided in MySQL manual on how to secure database user passwords in a MySQL options file. If there is no password for the user (not recommended), do not specify this parameter in the configuration file.
host
Fully qualified host name of the MySQL server. If this field is not specified, value from MySQL client configuration file - my.cnf is used.
port
MySQL server port. This parameter is optional. Default value is 3306.
socket
Name of the socket file used for communication with the MySQL server. This parameter is optional and must be specified if MySQL clients have to connect to MySQL server only using sockets. Example: /var/lib/mysql/mysql.sock
ssl-options
List of SSL options to connect to the MySQL server. These SSL options are required if the MySQL server has SSL enabled. This option is only used for logical backups.
   Example: ssl-options="--ssl --ssl-ca=<mysql_conf_dir>/openssl/cacert.pem --ssl-cert=<mysql_conf_dir>/openssl/client-cert.pem --ssl-key=<mysql_conf_dir>/openssl/client-key.pem"
routines
Set this parameter to backup stored routines in logical backups of the database/tables. The default is not backup stored routines.
default-character-set
The default character set used for logical backups of the database/tables. The default is utf-8.
mysql-binpath
The directory when MySQL commands are located. This parameter is optional. It is required only if the MySQL commands are not installed in default location (/usr/bin). Example: /opt/lampp/bin. By default, MySQL commands are searched in following directories: /usr/bin:/usr/sbin:/sbin:/bin:/usr/ucb
mysql-binlog-path
The directory where MySQL binary logs can be found. MySQL binary logs are required for incremental MySQL backups. This parameter is optional and default value is /var/lib/mysql. Example: /var/log/mysql.

ZRM Parameters

verbose
This field controls verbosity of ZRM for MySQL logging. Values can be 0 (terse) or 1(verbose). Default value is 0. ZRM for MySQL logs are available at /var/log/mysql-zrm/mysql-zrm.log directory.
mailto
Mail notifications about the backup run is sent to this mail address after every backup run. Usually the email address of the MySQL database administrator is specified in this field. This parameter is optional. If this parameter is not specified, email notifications are not sent.
html-reports
The list of pre-defined backup reports that are generated after each backup run for the backup set. This parameter is relevant only if html-report-directory parameter or webserver-url parameter are specified. If this parameter is not specified, backup-status-info pre-defined report is generated. Multiple pre-defined backup reports can be specified and must be separated by "," (comma).
html-report-directory
Directory location, along with full path, on the machine where ZRM for MySQL runs where HTML/text reports are created by mysql-zrm-reporter. When this parameter is specified, backup reports are automatically generated after the backup run. The list of backup reports should be specified in html-reports. The HTML reports are stored under sub-directory "html" and text backup reports are stored under sub-directory "text". This parameter also controls the directory where HTML reports are created when mysql-zrm-reporter command is run with -o output file option. If this parameter is not specified, the output file is created in current working directory. This parameter has no impact on email notifications after backup run.
webserver-url
The value of this parameter is the URL of the webserver location used to access the HTML reports and RSS feed. If backup reports should be available as RSS feed, this parameter and rss-header-location parameter must be specified. The list of reports that will be generated is specified as html-reports parameter. The html-report-directory must be accessible from the webserver document root. Example: http://www.company.com/reports/html
rss-header-location
URL of the webserver location used to access the HTML reports and RSS feed header file. Administrators are expected to customize the RSS channel properties using this file. A template of RSS header is available in /usr/share/mysql-zrm/plugins/RSS.header.

ZRM Plugin Parameters

All plugins are optional.

copy-plugin
Specify plugin along with full pathname to be used for transferring backup files to and from a remote MySQL server to the machine running ZRM for MySQL. This parameter is optional. Use this option when
  1. Remote incremental backup is required
  2. Copying replication related files from a remote machine
  3. Execute mysqlhotcopy and copy the data from the remote machine
  4. Restore data to a remote machine using mysqlhotcopy.
ssh-user
Specifies the user to be used for SSH. This parameter is only used by the ssh-copy.pl plugin. The user specified should either be the user mysqld runs as or root. If not specified the default value used is mysql. This parameter is optional.
remote-mysql-binpath
Full path where mysql binaries are installed on the remote machine. For example: /opt/lampp/bin. This parameter is only used by the socket-copy.pl and ssh-copy.pl plugins. If not specified, the default value used is /usr/bin.
socket-remote-port
Port that the socket-plugin.pl should use to connect. This parameter is only used by the socket-copy.pl plugin. If not specified the default value used is 25300. This parameter is optional
passfile
The file containing the passphrase used for GPG based data encryption. GPG based encryption plugin is available in /usr/share/mysql-zrm/plugins/encrypt.pl
pre-backup-plugin
Full path to pre-backup plugin script. This plugin is executed before a backup run for the backup set. A template is available in /usr/share/mysql-zrm/plugins directory.
pre-backup-plugin-options
List of options that are passed as arguments to the Pre-backup plugin. The list of options is specified as quoted string.
post-backup-plugin
Full path to post-backup plugin script. Post backup plugin is executed after a backup run for the backup set. A template is available in /usr/share/mysql-zrm/plugins directory.
post-backup-plugin-options
List of options that are passed as arguments to the Post-backup plugin. The list of options is specified as quoted string.
pre-scheduler-plugin
This plugin if provided is used to determine the start time for a backup run. This plugin can be used to delay or skip a backup run based on other conditions such as server or application load.