Mysql-zrm

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

NAME

mysql-zrm - Backup and recovery utility for ZRM for MySQL

SYNOPSIS

      mysql-zrm --action [ backup |
                           restore |
                           schedule-backup |
                           report |
                           list |
                           purge  |
                           parse-binlogs  |
                           check   |
                           verify-backup  |
                           extract-backup  |
                           abort-backup ]

DESCRIPTION

ZRM for MySQL provides automated scheduling of live MySQL database backup. You only need to configure it once to reflect the MySQL deployment, then schedule it to run unattended backups. Various options can help an administrator:

  • Verify the backups created.
  • Generate various types of reports about the backups created.
  • Specify compression and encryption as desired.
  • Report information about the backups via an email or RSS feed.
  • Access pre- and post- backup plugins to extend the suite further.
  • Control full and selective restore operations on the database, both locally and remotely.

ZRM for MySQL ’s primary command line utility is mysql-zrm, which provides the core backup/restore functions for MySQL databases.

Use the mysql-zrm.conf(5) configuration file to set mysql-zrm options.

Use the --action check option to verify the configuration of mysql-zrm.

Use mysql-zrm to create full or incremental backups of MySQL databases and perform full, incremental and selective restores as well. The --list option provides information about prior backups.

To display help on individual action options, append the --help option to the appropriate command line. For example:

 mysql-zrm --action backup --help

BACKUP SETS

ZRM for MySQL organizes the backups into backup sets. Each backup set defines:

  • a list of database(s) or table(s) within a database to back up
  • backup options to use on this backup set
  • scheduling options to use on this backup set.

Backup sets are identified by a unique name.

Every backup run (each time mysql-zrm is executed) is associated with one backup set. Various parameters can be associated with each backup run.

mysql-zrm first reads the global configuration file (/etc/mysql-zrm/mysql-zrm.conf). The global configuration file can be overridden by any backup set configuration file stored in /etc/mysql-zrm/backup set name/ directory. The mysql-zrm command line options will override the parameters specified in the configuration files.

BACKUP METHODS

mysql-zrm backups can be either full or incremental. Full backups can be logical backups or raw backups. Logical backups contain SQL statements to recreate the database. Raw backups are actual copies of the database files.

When logical backup is specified, the utility uses only mysqldump for backing up specified databases and tables.

When raw backup is specified, the utility has the ability to decide which backup mechanism to use for a particular database. If there are no transactional storage engine based tables in the specified database, it uses mysqlhotcopy for backing up that database. Otherwise, it uses mysqldump for backing up the specified database.

An index file is also created in the backup directory. The index contains the details of what was backed up, how much data was backed up, what parameters were used to backup the data, how much time it took to backup etc.

RECOVERY

When restoring databases, only the all-databases and databases options are allowed. In the case of clusters, only the all-databases option is allowed.

When the backup contains only specific tables from a database, you need to specify mysql-zrm action as restore and the database name to restore the backed up tables. Tables not included in the backup but present in the database will be left untouched.

ACTIONS

Specify backup to initiate a backup run.

Use restore to restore from a specified backup.

Use schedule-backup to setup the schedule for the backup.

Specify report to generate reports on backup runs.

Use check to verify if a backup set configuration is correct.

Use list to display the backup level, the name of the directory containing the backup and the index of the last backup of the specified backup set.

Action parse-binlogs will display the parsed output of the binary logs. This is useful to find out the log positions and/or timestamp to be used for restore operations.

Specify purge to remove backups present in the directory specified by the destination option whose retention policy has been exceeded.

Specify verify-backup to verify a backup

Use extract-backup to uncompress/decrypt a specified backup

Specify abort-backup to abort the backup run for a given backup-set.

OPTIONS

--action backup | restore | schedule-backup | report | list  |
         purge  |  parse-binlogs  |  check  | verify-backup |
         extract-backup | abort-backup

These mutually exclusive --action options choose the basic functionality of the utility. This form cannot be used in the configuration file.

FILES

/var/lib/mysql-zrm
Directory under which all backup data is stored.
/etc/mysql-zrm/backup set name/mysql-zrm.conf
Configuration file ZRM for MySQL.

RETURN VALUES

On success, zero is returned. On error, non-zero value is returned.

SEE ALSO

mysql-zrm-backup(1), mysql-zrm-manage-backup(1), mysql-zrm-restore(1), mysql-zrm-check(1), mysql-zrm-list(1), mysql-zrm-parse-binlogs(1), mysql-zrm-purge(1), mysql-zrm-extract-backup(1), mysql-zrm-verify-backup(1), mysql-zrm-abort-backup(1), mysql-zrm-scheduler(1), mysql-zrm-reporter(1), mysql-zrm.conf(5), mysqldump(1), mysqlbinlog(1), mysql(1), lvm(8)

AUTHOR

Zmanda Inc. (http://www.zmanda.com/)