MYSQL-ZRM-BACKUP(1)
mysql-zrm-backup(1) π
okay so bestie, pull up a chair, because <pink>mysql-zrm-backup</pink> is the whole entire manual page for the backup utility that ships with ZRM for MySQL, and I'm about to walk you through it like we're texting at 2am. no cap. every flag, every default, every warning β all of it, but make it β¨funβ¨.
NAME π
mysql-zrm-backup β the Backup utility for ZRM for MySQL. that's it, that's the name, she's simple and she's iconic.
SYNOPSIS πΈ
here's the vibe, the general shape of the thing:
mysql-zrm-backup
[--backup-set name]
[Backup Source Options]
[MySQL Access Options]
[Backup Method Options]
[Backup Destination Options]
[Logging and Notification Options]
[--options-file conf_file]
[--help]
Backup Source Synopsis π¦
mysql-zrm-backup
[--all-databases] | [--databases "dbname1 dbname2"...] |
[--database "name" [--tables tname1 tname2 ...]]
[--exclude-pattern pattern]
[--routines | --no-routines]
[--mysql-binpath MySQL_command_dir]
[--mysql-binlog-path MySQL_binary_log_dir]
[--config-file-list="config_file_pathname"]
MySQL Access Synopsis π
mysql-zrm-backup
[--user user]
[--password password]
[--host hostname]
[--port portnumber]
[--socket name]
[--ssl-options "MySQL ssl options"]
[--single-transaction [always|never|only-innodb]]
[--extra-mysqldump-options mysqldump_options]
[--extra-mydumper-options mydumper_options]
Compression and Encryption Synopsis ποΈ
mysql-zrm-backup
[--compress | --no-compress]
[--compress-mysqldump-onthefly | --no-compress-mysql-
dump-onthefly]
[--compress-plugin plugin_name]
[--no-encrypt | --encrypt]
[--encrypt-plugin plugin_name [--decrypt-option
option]]
[--passfile filename]
Plugin Synopsis π§
mysql-zrm-backup
[--pre-backup-plugin plugin]
[--pre-backup-plugin-options "option1 option2 ..."]
[--copy-plugin plugin]
[--ssh-user user]
[--ssh-identity-file filename]
[--remote-mysql-binpath path]
[--socket-remote-port port]
[--post-backup-plugin plugin]
[--post-backup-plugin-options "option1 option2 ..."]
Backup Method Synopsis π―
mysql-zrm-backup
[--backup-level level]
[--backup-mode raw | logical]
[--logical-parallel 0 | 1]
[--synchronous-checksum | --no-synchronous-checksum]
[--replication | --noreplication]
[--retention-policy backup_retention_time]
[--default-character-set char_set_name]
[--compress-data-during-transport]
Snapshot Plugin Synopsis πΈ
mysql-zrm-backup
[--snapshot-plugin="snapshot_plugin_pathname"]
[--check-innodb | --no-check-innodb]
[--backup-type regular|--backup-type quick]
--snapshot-plugin=""/usr/share/mysql-zrm/plugins/lvm-snapshot.pl"
[--snapshot-size size]
--snapshot-plugin="/usr/share/mysql-zrm/plugins/zfs-snapshot.pl"
(no options necessary)
Backup Destination Synopsis π¦
mysql-zrm-backup
[--backup-name image_name]
[--destination dir_path]
[--tmpdir temp_dir
Logging and Notification Synopsis π¬
mysql-zrm-backup
[--mailto address]
[--mail-policy always|never|only-on-error]
[--comment "comment string"]
[--quiet|--no-quiet]
[--verbose]
DESCRIPTION π
so ZRM for MySQL gives you automated scheduling of live MySQL database backup. the whole thing is: you configure it one time to match your MySQL deployment, and then you just schedule it and let it run unattended backups while you go live your life. π«Ά
and there's a whole pile of options that help an administrator:
- verify the backups that got created.
- generate all kinds of reports about the backups that got created.
- specify compression and encryption however you want them.
- report information about the backups via an email or an RSS feed.
- access pre- and post-backup plugins to extend the suite even further.
- control full and selective restore operations on the database, both locally and remotely.
mysql-zrm-backup is the one serving the core backup functions of ZRM for MySQL databases. main character energy, honestly.
use the mysql-zrm.conf(5) configuration file to set mysql-zrm-backup options that are described on this page. and use the --action check option to verify the configuration of mysql-zrm-backup. π
use mysql-zrm-backup to create full or incremental backups of MySQL databases.
want help on individual action options? just append the --help option to the command line. like, for example:
'mysql-zrm-backup --options-file --help'
BACKUP SETS ποΈ
ZRM for MySQL organizes backups into Backup Sets. every backup set defines the list of databases or tables within a database, how it should be backed up, and the backup schedule for that data. each backup set gets identified by a unique name. no duplicates, bestie, we don't do that here.
every single backup run β meaning every time mysql-zrm is executed β is associated with one backup set. and various parameters can be associated with each backup run.
here's the order of operations, listen up: mysql-zrm first reads the global configuration file at /etc/mysql-zrm/mysql-zrm.conf. that global config can be overridden by a backup-set-specific configuration file stored in the /etc/mysql-zrm/backup set name directory. and then the mysql-zrm command line options override the parameters specified in the configuration files. so it's like: global < backup set < command line. the command line always wins. periodt. π
BACKUP METHODS π₯
mysql-zrm backups can be either full or incremental. and 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 a logical backup is specified, the utility uses only mysqldump for backing up the specified databases and tables.
when a raw backup is specified, the utility gets to decide which backup mechanism to use for a particular database. if there are no transactional-storage-engine-based tables in the specified database, then it uses mysqlhotcopy for backing up that database. otherwise, it uses mysqldump for backing up the specified database. she's flexible like that. πββοΈ
Snapshot backups get their own moment in the Snapshot Options section of this man page β go look there, bestie.
when replication is specified and the MySQL server is a replication slave, then it will also back up all the replication-related files. no files left behind. π¦
when a destination is specified, then the backups are stored in a subdirectory under the specified directory. the default path is /var/lib/mysql-zrm. β οΈ and listen: if the destination you specified does not exist, it will return an error and exit β the utility does not create the directory for you. you gotta make it yourself. the audacity, I know.
an index file also gets created in the backup directory. the index is a file that contains the details of what was backed up, how much data was backed up, what parameters were used to back up the data, how much time it took to back up, etc. receipts, basically. π§Ύ
when an incremental backup is specified, the following options are ignored:
backup-mode,snapshot-plugin,all-databases,databases,databasetables
OPTIONS β¨π
you can select a backup set by name on the command line, or you can select source database(s), backup methods, plugins, etc. by using the options described in the Options subsections that follow. you can also specify mysql-zrm-backup options in a configuration file specified using the --options switch. choose your own adventure, babe. π
--backup-set nameβ specify the backup-set for the backup run. this is a command line option only and it cannot be specified in the configuration file. the default value isBackupSet1, and if such a value is already present, it will be used.--options-file conf_fileβ set the file, along with the full pathname, that containsmysql-zrm-backupconfiguration options. this file has the same format asmysql-zrm.conf(5).--helpβ displays the help message and exits. this is a command-line-only parameter and it cannot be specified in the configuration file.
Backup Source Options πΈ
--all-databasesβ opt for all databases to be backed up or restored. this is the default ifdatabaseordatabasesare not specified. she's the fallback queen. π--databases "name1 name2 ..."β list the databases to back up or restore.--database name [--tables "name1 name2 ..."]β list the tables that should be backed up. this option is valid during the backup operation only. note it, bestie.--exclude-pattern "pattern"β all databases or tables that match the pattern are not backed up. if--all-databasesor--databasesare specified, the exclude pattern applies to database names. if--databaseis specified, the exclude pattern applies to table names. wildcard characters are supported:*β match one or more characters?β match one character[]β match one of the characters specified within parenthesis|β match one of the patterns
for example: the exclude pattern "*_db|dbase[123]|abcd" will match names tom_db, dbase1, dbase2, abcd. all tables or databases that match this pattern will be excluded.
β οΈ the character # is not permitted in the exclude pattern. just don't, okay?
--routines|--no-routinesβ if--routinesis specified, thenmysqldumpwill dump stored routines. the default is--no-routines. this parameter is optional.--mysql-binpath mysql_command_dirβ set the full path where the mysql binary commands are installed. for example:/opt/lampp/bin. π--mysql-binlog-path mysql_binary_log_locationβ set the full path of the location of the mysql binary logs. for example:/var/log/mysql.--config-file-list="list_file_path"β intended for configuration file backup, this optional parameter lets you specify a list of files to backup duringβ¦
a full backup of literally any type β snapshot, logical, raw, all of it π
. The list_file_path is just the path to the file that holds the list of configuration files you wanna back up. And that list itself has to spell out full pathnames, separated by newlines. No shortcuts, bestie.
The config-file-list gets processed after the main data has already been backed up, and the list file itself gets copied over to the destination directory right along with the configuration files. The backup index will record the config-file-list parameter. π
And the slay part: files you named in config-file-list get re-stored during a full restore to their original locations, with permissions and ownership preserved. π«Ά
πΈ MySQL Access Options πΈ
--user userβ Says who the MySQL backup/restore user is on the MySQL server. If you don't specify a user here, just make sure the MySQL user you set up in themy.cnfor--optionsfile actually has the privileges it needs. Otherwise, chaos. π--password passwordβ The password for that MySQL user. If you do not want your password getting yeeted across the network in plaintext, maybe set the MySQL username and password in the MySQLmy.cnfor--optionsfile instead. Just a thought. π--host hostnameβ Specify the MySQL server host name or IP name.--port portnumberβ Specify the MySQL server port.--socket nameβ Specify which socket file to use when talking to the MySQL server.--ssl-options "MySQL ssl options"β Set any--ssl*options that MySQL supports. Peep the MySQL Documentation if you want the deets on SSL options.--single-transaction [always|never|only-innodb]β This one controls under what circumstances MySQL for ZRM passes the--single-transactionoption setting tomysqldumpwhen it runs a database dump.alwaysmeans--single-transactionis always passed,nevermeans it's never passed, andonly-innodbmeans it's only passed during innodb-only backups. For example, if you sayonly-innodb, the--single-transactionwill not be passed for backups that include myisam or other non-transactional tables. ikyk. π--extra-mysqldump-options="mysqldump_options"β Use this to pass any extramysqldumpoptions when ZRM for MySQL runs amysqldump. For example, if you needmysqldumpto run with the--flush-logsand--no-create-infooptions, specify--extra-mysqldump-options="--flush-logs --no-create-info"in themysql-zrm.conffile.--extra-mydumper-options="mydumper_options"β Use this to pass any extramydumperoptions when ZRM for MySQL runs amydumper. For example, if you needmydumperto run with the--threadsand--regexoptions, specify--extra-mydumper-options="--threads=4 --regex='Regular expression for 'db.table' matching'"in themysql-zrm.conffile.
π₯ Backup Method Options π₯
--backup-level levelβ Choose0for a full backup. Choose1for an incremental back up. Default is full backup. Simple as that. β¨--backup-mode raw|logicalβ Databases/tables that use a transactional engine cannot be backed up bymysqldumpβ those needmysqlhotcopy. So: chooserawto usemysqlhotcopyto back up the database/tables that use a transactional engine, and chooselogicalto usemysqldumpto back up the database/tables that don't use a transactional engine. Default value israw. π--logical-parallel |1β Choose0for amysqldumpbackup. Choose1for amydumpermulti-thread logical back up. Default ismysqldumpbackup.--synchronous-checksum | --no-synchronous-checksumβ Says whether a checksum should be produced during the backup process. Default is--no-synchronous-checksum, in which case the checksum is produced only after the backup process is complete. Heads up: specifying--synchronous-checksumsignificantly increases overall backup times. Not a vibe if you're in a hurry. π--replication | --noreplicationβ Choosereplicationto back up replication files. They'll only get backed up if the host is a replication slave. Default option is--noreplication.--default-character-set char_set_nameβ The default character set thatmysqldumpshould use. If it's not specified,utf8is used. This parameter is optional.--compress-data-during-transportβ If the value is set to1, the backup gets compressed when it's transferred from the MySQL server to the ZRM server. Set the value to zero and no compression happens. No compression is performed by default. And fyi: data compression during transfer is independent of the Backup compression parameter. π§
π Plugin Options π
--pre-backup-plugin pluginβ (Optional) Specify the plugin, along with its full pathname, to be called before a backup run. Every pre-backup plugin script has to accept these command-line parameters (which get passed to the plugin using--pre-backup-plugin-options:--all-databasesβ Use when all databases on the server are being backed up.--database database1 database2...β Use when selected databases are being backed up.--database database --tables table1 table2...β Use if selected tables are being backed up.
The script should be written to return a non-zero value on error; pre-backup plugin failures should cancel the backup and generate a failure message for reports and logs. No quiet fails, periodt. π«
--pre-backup-plugin-options "option1 option2..."β Pass options to thepre-backup-pluginas one of the command line arguments.--copy-plugin pluginβ Specify the 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. Use this option when:- remote incremental backup is required
- copying replication related files from a remote machine
- execute
mysqlhotcopy(MySQL command) and copy the data from the remote machine - restore data to a remote machine using
mysqlhotcopy(MySQL command).
This parameter is optional.
--ssh-user userβ Specifies the user to be used for SSH. This parameter is only used by thessh-copy.plplugin. The user you pick should either be the usermysqldruns as, orroot. If you don't specify one, the default value used ismysql. This parameter is optional.--ssh-identify-file filenameβ Selects a file from which the identity (private key) for RSA or DSA authentication is read. This identity file is used by thessh-copy.plplugin for authentication. π--remote-mysql-binpath pathβ Full path where the mysql binaries are installed on the remote machine. For example:/opt/lampp/bin. This parameter is only used by thesocket-copy.plandssh-copy.plplugins. If not specified, the default value used is/usr/bin.--socket-remote-port portβ The port that thesocket-plugin.plshould use to connect. This parameter is only used by thesocket-copy.plplugin. If not specified, the default value used is25300. This parameter is optional.--post-backup-plugin pluginβ Set the plugin, along with full pathname, to be called after a backup run. Ifsynchronous-checksumis not set, or its value is set to zero, the post backup plugin gets called twice β once at the end of backup, and once when the checksum is finished. Twice the drama, twice the fun. π--post-backup-plugin-options "Option1 Option2 Option3 Option4..."βoption1is the value ofpost-backup-plugin-optionsfrom themysql-zrm.conf(5)file.option2is the data being backed up. It will be either:--all-databasesβ Use when all databases on the server are being backed up.--database database1 database2...β Use when selected databases are being backed up.--database database --tables table1 table2...β Use if selected tables are being backed up.
Option3 will be --backup-directory path.
Option4 will be --checksum-pending or it will be --checksum-finished if synchronous-checksum is set to 1.
If synchronous-checksum is not set or its value is set to zero, the post-backup-plugin is called again and it will have 3 parameters. First parameter is the value of post-backup-plugin-options from the mysql-zrm.conf(5) configuration file. Second parameter will be --backup-directory path. Third parameter will be --checksum-finished.
π Compression and Encryption Options π
--compress | --no-compressβ Choose whether the files should be compressed using the utility specified by the--compress-plugin. The default is--no-compress.--compress-mysqldump-onthefly | --no-compress-mysqldump-ontheflyβ Choose whether to compress the data dumped bymysqldumpon the fly. Default compression command used isgzip. Default is no compression on the fly.--compress-plugin plugin_nameβ Useplugin_nameto specify a path to the utility to use for compression. The default isgzip.--no-encrypt | --encryptβ Choose whether the files should be encrypted using the utility specified by the--encrypt-plugin. The default is--no-encrypt.--encrypt-plugin plugin_name [--decrypt-option [option]β Useplugin_nameto specify a utility to use for compression, along with its full path. If--decrypt-optionis
...if that thing isn't specified, then the -d option of encrypt-plugin is the one that gets used for decrypting. periodt. π
--passfile filenameβ okay so the original literally just drops the option name here and gives you nothing else, bestie. No description, no nothing. I'm not about to invent one for you, so: here it is, exactly as written. π
β¨ Snapshot Plugin Options β¨
--snapshot-plugin="plugin_pathname"β tells ZRM which plugin handles your snapshot operations. The default? Thelvm-snapshotplugin. Slay. π§[--check-innodb | --no-check-innodb]β this one decides whether we go looking for innodb shared data and log files to back up during every single snapshot-based backup (the original says "based based" and honestly? iconic typo behavior π). Here's the vibe check:- if you pass
--check-innodb, innodb shared data and logs only get backed up if the databases you're backing up actually use innodb. - if you pass
--no-check-innodb(which is the default), those innodb databases and logs get backed up regardless of whether they're relevant at all. The default value is--no-check-innodb, which means innodb shared data and logs are always copied if the innodb engine is enabled in MySQL. In most cases,--no-check-innodbgives you the best performance. ποΈ
- if you pass
--snapshot-size sizeβ sets the size of the lvm-snapshot that's gonna be generated. For raw backups, every specified database gets checked first to make sure it's on a LVM volume, and then a snapshot of the size you named gets created and used to back up the database. If the database you specified is not on a LVM volume, then either mysqlhotcopy or mysqldump gets used to create the backup, based on whatever logic the--backup-modeoption laid out. Also important: this option gets ignored if the--backup-modeis logical. π ββοΈ--backup-type regular|--backup-type quickβ pick your snapshot backup method, bestie.regularmeans the snapshot gets copied into a standard ZRM for MySQL backup archive.quickmeans the snapshot itself becomes a near-line backup. Quick backups are convenient because they give you near-instantaneous restores, but because they stay sitting on the MySQL server, they do not protect you against media or server failure. π
β οΈ Heads up: if thequickoption is specified, thecompressandencryptoptions are ignored, and the backup size will always be zero. On top of that, no checksums are performed, which means quick snapshot backups cannot be verified. Not the move if you care about integrity, ngl.
β¨ Backup Destination Options β¨
--backup-name image_nameβ give your backup a unique name to be stored under. If you don't specify a name, or if it already exists in the--destinationdirpath (peep the next option), the backup image gets named with the current date and time instead. β°--destination dir_pathβ where your backup lives. Default location is/var/lib/mysql-zrm/. If you pick a directory that isn't the default, you have to create it manually on both the MySQL server and the ZRM server, and it must have permissions set to allow read/write access to the mysql backup user. π«Ά
β¨ Logging and Notification Options β¨
--mailto addressβ set the address where a backup report gets sent. π§--mail-policy always|never|only-on-errorβ mail policy = when do emails actually fire off? Here's the breakdown:alwaysis the default β email notification is sent for all events.neverβ email notification is not sent for all events.only-on-errorβ notification is sent when there's a backup failure, ifmailtois specified.
--comment "Comment string"β drop a comment or a note about the backup run. You can use this to tag backup runs, and you can retrieve that note later with themysql-zrm-reporter(1)utility. π·οΈ--quiet | --no-quietβquietsuppresses the display of log messages on stdout.no-quietshows those log messages on stdout. Default is--no-quiet. π€«--verboseβ gives you verbose output in the log. Default is that verbose is turned off and a terse output is generated. β¨
π FILES π
/var/lib/mysql-zrmβ default directory for storing all backup data. πΎ/etc/mysql-zrm/backup set name/mysql-zrm.confβ default location for the backup-set configuration file used by themysql-zrm-backuputility. π
π¦ RETURN VALUES π¦
On success, zero is returned. On error, a non-zero value is returned. Simple as that, bestie. π
π SEE ALSO π
mysql-zrm(1)mysql-zrm-manage-backup(1)mysql-zrm-restore(1)mysql-zrm-check(1)mysql-zrm-list(1)mysql-zrm-getconf(1)mysql-zrm-setconf(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)- Zmanda Recovery Manager for MySQL (
http://mysql-backup.zmanda.com/)
π AUTHOR π
Zmanda Inc. (http://www.zmanda.com)
and that's the whole page, bestie!! πβ¨ This cutie came out of the ZRM for MySQL manual, page mysql-zrm-backup(1), brought to you by Zmanda, Inc. (no date on this chunk, sorry β nothing to report there π). Now go back up your databases responsibly. mwah. ππ¦π
π¦ where this page comes from
- epel 9: MySQL-zrm 3.0-38.el9 Β· GPLv2
- fedora 43: MySQL-zrm 3.0-44.fc43 Β· GPL-2.0-only
- fedora 44: MySQL-zrm 3.0-46.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms