Options

Database engine

Main

Connection

Dump action

Dump compression

Configuration files

Output

Verbosity

Database engine

<DBMS> (psql|mysql)

Default: no default (mandatory)

Database engine to use. Either postgresql or mysql (mariasql compatible).

Read zabbix configuration

--read-zabbix-config, -z

Default: False

Try to read database host and credentials from Zabbix config. The file is read and parsed trying to collect as much as possible. Every variable collected will be used if not already provided by user arguments.

Implicit if --zabbix-config is set.

Zabbix configuration file

--zabbix-config ZBX_CONFIG, -Z ZBX_CONFIG

Default: /etc/zabbix/zabbix_server.conf

Zabbix configuration file path.

Read MySQL configuration (MySQL specific)

--read-mysql-config, -c

Default: False

Read database host and credentials from MySQL config file. Implicit if --mysql-config is set.

MySQL configuration file (MySQL specific)

--mysql-config MYSQL_CONFIG, -C MYSQL_CONFIG

Default: /etc/mysql/my.cnf

MySQL configuration file path. Implicit if --read-mysql-config is set.

Dry run

--dry-run, -D

Default: False

Do not create the actual backup, only show dump commands. Be aware that the database will be queried for tables selection and folders and files will be created. This is meant only for setup, inspection and debugging.

Hostname (special for Postgres)

--host, -H

Default: 127.0.0.1

Hostname/IP of DBMS server, to specify a blank value pass -.

For postgresql special rules might apply (see Postgres psql and pg_dump online documentation for sockets).

Port

--port PORT, -P PORT

Default: 5432 for Postgres, 3306 for MySQL)

Database connection port.

Socket (Mysql specific)

--socket SOCK, -S SOCK

Default: None

Path to MySQL socket file. Alternative to specifying host.

Username

--user USER, -u USER

Default: zabbix

Username to use for the database connection.

Password

--passwd PASSWD, -p PASSWD

Default: None

Database login password. Specify - for an interactive prompt. For Postgres, a .pgpass will be created to connect to the database and then deleted (might be saved with the backup).

Keep login file

--keep-login-file

Default: False

Do not delete login file (either .pgpass or mylogin.cnf) on program exit.

Useful to create the login file and avoid clear password or interactive prompt.

For postgres, the saved file is not hidden (pgpass).

Login file

--login-file LOGINFILE

Default: None

Use this file (either .pgpass or mylogin.cnf) for the authentication.

Database name

--database DBNAME, -d DBNAME

Default: zabbix

The name of the database to connect to.

Database schema (Postgres specific)

--schema SCHEMA, -s SCHEMA

Default: public

The name of the schema to use.

Reverse lookup

--reverse-lookup, -n

Default: True

(NOT IMPLEMENTED) Perform a reverse lookup of the IP address for the host.

Name

--name

Default: None

Use this name instead of host while creating the name of the archive.

The name must be alphanumeric, only - and . special characters are allowed).

Using this option automatically disable --reverse-lookup!

Unknown tables action

--unknown-action {dump,nodata,ignore,fail}, -U {dump,nodata,ignore,fail}

Default: ignore

Action for unknown tables.

Choose dump to dump the tables fully with definitions. nodata will include only the definitions. ignore will skip the unknown tables. fail will abort the backup in case of an unknown table.

Monitoring tables action

--monitoring-action {dump,nodata}, -U {dump,nodata}

Default: nodata

Action for monitoring table.

Choose dump do dump the tables fully with definitions. nodata will include only the definitions.

Add columns

--add-columns, -N

Default: False

Add column names in INSERT clauses and quote them as needed.

Postgres dump format

--pgformat PGFORMAT

Default: custom

Dump format, will mandate the file output format.

Available formats: plain, custom, directory, or tar (see postgres documentation).

Postgres dump compression

--pgcompression PGCOMPRESSION

Default: None

Passed as-is to pg_dump --compress, might be implied by format (see postgres documentation).

Be aware that the postgres tar format won’t be compressed. In that case you could use --archive.

Dump compression

--mysqlcompression MYSQLCOMPRESSION

Default: -

Mysql dump compression.

- to leave the dump uncompressed as is.

Available compression formats are xz, gzip and bzip2. Use :<LEVEL> to set a compression.

The compression binary must be available in current shell. xz, gzip, and bzip2 will take precedence and 7z is used as fallback (might be useful on Windows platforms).

NOTE: on windows platforms this result is a compressed file with CRLF line termination instead of LF.

Save configuration files

--save-files

Default: False

Save folders and other files in the backup (see –files).

File index to save with the backup

--files FILES

Default: -

Save folders and other files as listed in this index file. Non existant will be ignored. Directory structure is replicated (copied via cp).

File format: one line per folder or file.

If FILES is - then the standard files are selected, i.e: /etc/zabbix/ and /usr/lib/zabbix/.

Backup archive format

--archive ARCHIVE, -a ARCHIVE

Default: -

Use tar to create a tar archive.

- to leave the backup uncompressed as a folder.

Available compression formats are xz, gzip and bzip2. Use :<LEVEL> to set a compression level. I.e. --archive xz:6.

Output directory

--outdir OUTDIR, -o OUTDIR

Default: .

The destination directory to save the backup to.

Backup rotation

--rotate ROTATE, -r ROTATE

Default: 0

Rotate backups while keeping up R old backups. Uses filenames to find old backups.
0 = keep everything.

Verbosity

--quiet, -q

--verbose, -v

--very-verbose, -V

--debug

Default: verbose

Don’t print anything except unrecoverable errors (quiet),
print informations only (verbose),
print even more informations (very verbose),
print everything (debug).