The xtrabackup Option Reference

This page documents all of the command-line options for the xtrabackup binary.

Options

--apply-log-only

This option causes only the redo stage to be performed when preparing a backup. It is very important for incremental backups.

--backup

Make a backup and place it in --target-dir. See Creating a backup.

--compress

This option tells xtrabackup to compress all output data, including the transaction log file and meta data files, using the specified compression algorithm. The only currently supported algorithm is ‘quicklz’. The resulting files have the qpress archive format, i.e. every *.qp file produced by xtrabackup is essentially a one-file qpress archive and can be extracted and uncompressed by the qpress file archiver.

--compress-threads=#

This option specifies the number of worker threads used by xtrabackup for parallel data compression. This option defaults to 1. Parallel compression (‘–compress-threads’) can be used together with parallel file copying (‘–parallel’). For example, ‘–parallel=4 –compress –compress-threads=2’ will create 4 IO threads that will read the data and pipe it to 2 compression threads.

--create-ib-logfile

This option is not currently implemented. To create the InnoDB log files, you must prepare the backup twice at present.

--datadir=DIRECTORY

The source directory for the backup. This should be the same as the datadir for your MySQL server, so it should be read from my.cnf if that exists; otherwise you must specify it on the command line.

--defaults-extra-file=[MY.CNF]

Read this file after the global files are read. Must be given as the first option on the command-line.

--defaults-file=[MY.CNF]

Only read default options from the given file. Must be given as the first option on the command-line. Must be a real file; it cannot be a symbolic link.

--defaults-group=GROUP-NAME

This option is to set the group which should be read from the configuration file. This is used by innobackupex if you use the –defaults-group option. It is needed for mysqld_multi deployments.

--export

Create files necessary for exporting tables. See Restoring Individual Tables.

--extra-lsndir=DIRECTORY

(for –backup): save an extra copy of the xtrabackup_checkpoints file in this directory.

--incremental-basedir=DIRECTORY

When creating an incremental backup, this is the directory containing the full backup that is the base dataset for the incremental backups.

--incremental-dir=DIRECTORY

When preparing an incremental backup, this is the directory where the incremental backup is combined with the full backup to make a new full backup.

--incremental-lsn=LSN

When creating an incremental backup, you can specify the log sequence number (LSN) instead of specifying --incremental-basedir. For databases created by MySQL and Percona Server 5.0-series versions, specify the LSN as two 32-bit integers in high:low format. For databases created in 5.1 and later, specify the LSN as a single 64-bit integer. ##ATTENTION##: If a wrong LSN value is specified (a user error which XtraBackup is unable to detect), the backup will be unusable. Be careful!

--innodb-miscellaneous

There is a large group of InnoDB options that are normally read from the my.cnf configuration file, so that xtrabackup boots up its embedded InnoDB in the same configuration as your current server. You normally do not need to specify these explicitly. These options have the same behavior that they have in InnoDB or XtraDB. They are as follows:

--innodb-adaptive-hash-index
--innodb-additional-mem-pool-size
--innodb-autoextend-increment
--innodb-buffer-pool-size
--innodb-checksums
--innodb-data-file-path
--innodb-data-home-dir
--innodb-doublewrite-file
--innodb-doublewrite
--innodb-extra-undoslots
--innodb-fast-checksum
--innodb-file-io-threads
--innodb-file-per-table
--innodb-flush-log-at-trx-commit
--innodb-flush-method
--innodb-force-recovery
--innodb-io-capacity
--innodb-lock-wait-timeout
--innodb-log-buffer-size
--innodb-log-files-in-group
--innodb-log-file-size
--innodb-log-group-home-dir
--innodb-max-dirty-pages-pct
--innodb-open-files
--innodb-page-size
--innodb-read-io-threads
--innodb-write-io-threads
--log-copy-interval=#

This option specifies time interval between checks done by log copying thread in milliseconds (default is 1 second).

--log-stream

Makes xtrabackup not copy data files, and output the contents of the InnoDB log files to STDOUT until the --suspend-at-end file is deleted. This option enables --suspend-at-end automatically.

--no-defaults

Don’t read default options from any option file. Must be given as the first option on the command-line.

--parallel=#

This option specifies the number of threads to use to copy multiple data files concurrently when creating a backup. The default value is 1 (i.e., no concurrent transfer).

--prepare

Makes xtrabackup perform recovery on a backup created with --backup, so that it is ready to use. See preparing a backup.

--print-defaults

Print the program argument list and exit. Must be given as the first option on the command-line.

--print-param

Makes xtrabackup print out parameters that can be used for copying the data files back to their original locations to restore them. See Scripting Backups With xtrabackup.

--stats

Causes xtrabackup to scan the specified data files and print out index statistics.

--stream=NAME

Stream all backup files to the standard output in the specified format. Currently supported formats are ‘xbstream’ and ‘tar’.

--suspend-at-end

Causes xtrabackup to create a file called xtrabackup_suspended in the --target-dir. Instead of exiting after copying data files, xtrabackup continues to copy the log file, and waits until the xtrabackup_suspended file is deleted. This enables xtrabackup and other programs to coordinate their work. See Scripting Backups With xtrabackup.

--tables=NAME

A regular expression against which the full tablename, in databasename.tablename format, is matched. If the name matches, the table is backed up. See partial backups.

--tables-file=NAME

A file containing one table name per line, in databasename.tablename format. The backup will be limited to the specified tables. See Scripting Backups With xtrabackup.

--target-dir=DIRECTORY

This option specifies the destination directory for the backup. If the directory does not exist, xtrabackup creates it. If the directory does exist and is empty, xtrabackup will succeed. xtrabackup will not overwrite existing files, however; it will fail with operating system error 17, file exists.

If this option is a relative path, it is interpreted as being relative to the current working directory from which xtrabackup is executed.

--throttle=#

This option limits --backup to the specified number of read+write pairs of operations per second. See throttling a backup.

--tmpdir=DIRECTORY

This option is currently not used for anything except printing out the correct tmpdir parameter when --print-param is used.

--use-memory=#

This option affects how much memory is allocated for preparing a backup with --prepare, or analyzing statistics with --stats. Its purpose is similar to innodb_buffer_pool_size. It does not do the same thing as the similarly named option in Oracle’s InnoDB Hot Backup tool. The default value is 100MB, and if you have enough available memory, 1GB to 2GB is a good recommended value. Multiples are supported providing the unit (e.g. 1MB, 1M, 1GB, 1G).

--version

This option prints xtrabackup version and exits.

Percona XtraBackup
Call Us
+1-888-316-9775 (USA - Sales)
+1-208-473-2904 (USA - Sales)
+44-208-133-0309 (UK - Sales)
0-800-051-8984 (UK - Sales)
0-800-181-0665 (GER - Sales)
+1-877-862-4316 (Emergency)
+1-855-55TRAIN (Training)
+1-925-271-5054 (Training)

Table Of Contents

Previous topic

xtrabackup Exit Codes

Next topic

The xbstream Binary

This Page



© Copyright Percona LLC and/or its affiliates, 2009-2013.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
Created using Sphinx 1.2.2.
This documentation is developed in Launchpad as part of the Percona XtraBackup source code.
If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please file a bug.
]]>