4.1.12 Options for Special Backup Types

These options are for backing up database servers that play specific roles in replication, or contain certain kinds of data that require special care in backing up.


This option is useful when backing up a replication slave server. It prints the binary log position and name of the binary log file of the master server. It also creates a file meta/ibbackup_slave_info inside the backup directory, containing a CHANGE MASTER statement with the same information. A new slave for this master can be set up by starting a slave server on this backup and issuing a CHANGE MASTER command with the binary log position saved in the ibbackup_slave_info file. See Section 5.4, “Setting Up a New Replication Slave” for instructions.


This option pauses the mysqlbackup command when the backup procedure is close to ending. It creates a file called ibbackup_suspended in the backup log group home directory and waits until you delete that file before proceeding. This option is useful to customize locking behavior and backup of non-InnoDB files through custom scripting.

All tables are locked before suspending, putting the database into a read-only state, unless you turn off locking with the --no-locking or --no-connection option. The --only-innodb option also prevents the locking step. Because locking all tables could be problematic on a busy server, you might use a combination of --only-innodb and --suspend-at-end to back up only certain non-InnoDB tables.

--exec-when-locked="utility arg1 arg2 ..."

You can use this option to write a script that backs up any information that is not part of the usual backup, for example by using mysqldump to back up tables from the MEMORY storage engine that are not on disk. Within your script, the BACKUP_DIR environment variable is set and points to the current backup directory. For example, on Unix or Linux systems, using single quotes to prevent premature expansion of $BACKUP_DIR: --exec-when-locked='mysqldump mydb t1 > $BACKUP_DIR/t1.sql'. Or on Windows systems: --exec-when-locked="mysqldump mydb t1 > %BACKUP_DIR%/t1.sql"

If the utility cannot be executed or returns a non-zero exit status, then the whole backup process is cancelled. If --suspend-at-end option is also used, the utility specified by --exec-when-locked is executed after suspending.