Overview of the gpbackup syntax
The gpbackup utility has the following syntax:
gpbackup --dbname <database_name>
[--backup-dir <directory>]
[--compression-level <level>]
[--compression-type <type>]
[--copy-queue-size <int>]
[--data-only]
[--debug]
[--exclude-schema <schema> [--exclude-schema <schema> ...]]
[--exclude-table <schema.table> [--exclude-table <schema.table> ...]]
[--exclude-schema-file <file_name>]
[--exclude-table-file <file_name>]
[--include-schema <schema> [--include-schema <schema> ...]]
[--include-table <schema.table> [--include-table <schema.table> ...]]
[--include-schema-file <file_name>]
[--include-table-file <file_name>]
[--incremental [--from-timestamp <backup-timestamp>]]
[--jobs <int>]
[--leaf-partition-data]
[--metadata-only]
[--no-compression]
[--no-inherits]
[--no-history]
[--plugin-config <config_file_location>]
[--quiet]
[--single-data-file]
[--single-backup-dir]
[--verbose]
[--with-stats]
[--without-globals]
gpbackup --help
gpbackup --version
Options
| Option | Description |
|---|---|
--dbname <dbname> |
The name of the database to back up. This option is mandatory |
--backup-dir <directory> |
The directory for creating backup files. The value must be an absolute path. By default, backups are created in the backups directory located:
Each backup is placed in a separate subdirectory named by date and timestamp in the following format: YYYYMMDD/YYYYMMDDHHMMSS/. Learn more in Define backup location |
--compression-level <level> |
Compression level from To create a backup with uncompressed data in the CSV format, use the Learn more in Configure backup compression |
--compression-type <type> |
Compression algorithm for data files:
Learn more in Configure backup compression |
--copy-queue-size <int> |
When Incompatible with |
--data-only |
Backs up only table data, without metadata such as SQL commands that create tables and other database objects |
--debug |
Adds |
--exclude-schema <schema> |
Excludes the specified schema from the backup. Can be specified multiple times. If a schema name includes characters other than lowercase letters, digits, or underscores, enclose this name in double quotes. Incompatible with all other options that filter schemas ( Learn more in Partial backups |
--exclude-schema-file <file_name> |
Excludes the schemas listed in a file from the backup. The file must list one schema per line and have no trailing blank lines. If a schema name includes characters other than lowercase letters, digits, or underscores, enclose this name in double quotes. Incompatible with all other options that filter schemas ( Learn more in Partial backups |
--exclude-table <schema.table> |
Excludes the specified table or other object — sequence, view, or materialized view — from the backup.
Can be specified multiple times.
The object name must be in the Incompatible with options that exclude schemas ( Learn more in Partial backups |
--exclude-table-file <file_name> |
Excludes the tables and other objects — sequences, views, or materialized views — listed in a file from the backup.
The file must list one object per line and have no trailing blank lines.
Each object name must be in the Incompatible with schema filtering options Learn more in Partial backups |
--include-schema <schema> |
Backs up only the specified schema. Can be specified multiple times. If a schema name includes characters other than lowercase letters, digits, or underscores, enclose this name in double quotes. Incompatible with other options that filter schemas ( Learn more in Partial backups |
--include-schema-file <file_name> |
Backs up only schemas listed in a file. The file must list one schema per line and have no trailing blank lines. If a schema name includes characters other than lowercase letters, digits, or underscores, enclose this name in double quotes. Incompatible with other options that filter schemas ( Learn more in Partial backups |
--include-table <schema.table> |
Backs up only the specified table or other object — sequence, view, or materialized view.
Can be specified multiple times.
The object name must be in the Incompatible with other options that filter schemas ( Note that
Learn more in Partial backups |
--include-table-file <file_name> |
Backs up only tables or other objects — sequences, views, or materialized views — listed in a file.
The object name must be in the Incompatible with other options that filter schemas ( Note that
Learn more in Partial backups |
--incremental |
Creates an incremental backup to append to an incremental backup set. Such a set includes one full backup and one or more incremental backups. When invoked with This option requires Learn more in Incremental backups |
--from-timestamp <backup-timestamp> |
Specifies the timestamp of an existing backup to use as the base for an incremental backup. That backup must be compatible with the incremental backup being created. Can be used only with Learn more in Incremental backups |
--jobs <int> |
The number of jobs to use for parallel backup.
By default, Incompatible with Learn more in Parallel backup and restore |
--leaf-partition-data |
Creates a separate data file per leaf partition of a partitioned table.
Without Required for partition-level inclusion or exclusion with schema and table filtering options such as Learn more in Partitioned tables |
--metadata-only |
Backs up only object metadata, such as SQL commands that create database objects, without actual table data |
--no-compression |
Does not compress data files of the backup. Learn more in Configure backup compression |
--no-inherits |
When using table inclusion options |
--no-history |
Skips recording information about the backup operation in the backup history service database ( |
--plugin-config <config_file_location> |
The location of a
Backups created with a plugin require the same plugin for restore. Incompatible with |
--quiet |
Suppresses all output except warning or error messages |
--single-data-file |
Creates a single data file per segment for all tables on that segment.
Without Note that backups created with this option cannot be restored in parallel with Learn more in Define backup layout |
--single-backup-dir |
Saves all files per host in a single directory instead of creating a separate directory for each segment.
With this option, Learn more in Define backup layout |
--verbose |
Adds |
--with-stats |
Includes database statistics in the backup |
--without-globals |
Excludes the global Greengage DB system objects — roles, tablespaces, resource queues and groups, and so on — from the backup |
--version |
Prints the |
--help |
Displays the help information about |
Return codes
gpbackup has the following return codes:
-
0— backup completed successfully. -
1— backup completed with non-fatal errors. -
2— backup failed.