Scroll to navigation

pgbackrest(1) pgBackRest Command Reference pgbackrest(1)

NAME

pgBackRest - Reliable PostgreSQL Backup & Restore

SYNOPSIS

pgbackrest [options] [command]

DESCRIPTION

pgBackRest is a reliable backup and restore solution for PostgreSQL that seamlessly scales up to the largest databases and workloads.

COMMANDS

Add or modify backup annotation.
Get a WAL segment from the archive.
Push a WAL segment to the archive.
Backup a database cluster.
Check the configuration.
Expire backups that exceed retention.
Get help.
Retrieve information about backups.
Get a file from a repository.
List files in a repository.
Restore a database cluster.
pgBackRest server.
Ping pgBackRest server.
Create the required stanza data.
Delete a stanza.
Upgrade a stanza.
Allow pgBackRest processes to run.
Stop pgBackRest processes from running.
Verify contents of the repository.
Get version.

OPTIONS

Annotate Options:

Backup set to annotate.

Archive Options:

Push/get WAL segments asynchronously.
Maximum size of the pgBackRest archive-get queue.
Retry missing WAL segment
Maximum size of the PostgreSQL archive queue.
Archive timeout.

Backup Options:

Annotate backup with user-defined key/value pairs.
Check that WAL segments are in the archive before backup completes.
Copy WAL segments needed for consistency to the backup.
Check the PostgreSQL archive_mode setting.
Backup from the standby cluster.
Validate data page checksums.
Exclude paths/files from the backup.
Automatically run the expire command after a successful backup.
Force an offline backup.
Manifest save threshold during backup.
Perform an online backup.
Allow resume of failed backup.
Force a checkpoint to start backup quickly.
Stop prior failed backup on new backup.
Backup type.

Expire Options:

Backup set to expire.

General Options:

Buffer size for I/O operations.
pgBackRest command.
SSH client command.
Use file compression.
File compression level.
Network compression level.
File compression type.
pgBackRest configuration file.
Path to additional pgBackRest configuration files.
Base path of pgBackRest configuration files.
Database query timeout.
Restore or backup using checksums.
Execute a dry-run for the command.
I/O timeout.
Path where lock files are stored.
Use a neutral umask.
Max processes to use for compress/transfer.
Protocol timeout.
Do not transform data.
Keep-alive enable.
Path where transient data is stored.
Defines the stanza.
Keep-alive count.
Keep-alive idle time.
Keep-alive interval time.

Info Options:

Output format.
Backup set to detail.
Filter on backup type.

Log Options:

Level for console logging.
Level for file logging.
Level for stderr logging.
Path where log files are stored.
Enable logging in subprocesses.
Enable timestamp in logging.

Maintainer Options:

Check PostgreSQL version/id in WAL headers.
Check PostgreSQL page headers.
Force PostgreSQL version.

Repo-get Options:

Ignore missing source file.

Repo-ls Options:

Filter output with a regular expression.
Output format.
Include all subpaths in output.
Sort output ascending, descending, or none.

Repository Options:

Set repository.
Azure repository account.
Azure repository container.
Azure repository endpoint.
Azure repository key.
Azure repository key type.
Azure URI Style.
Enable block incremental backup.
Bundle files in repository.
Limit for file bundles.
Target size for file bundles.
Repository cipher passphrase.
Cipher used to encrypt the repository.
GCS repository bucket.
GCS repository endpoint.
GCS repository key.
GCS repository key type.
Hardlink files between backups in the repository.
Repository host when operating remotely.
Repository host certificate authority file.
Repository host certificate authority path.
Repository host certificate file.
Repository host pgBackRest command.
pgBackRest repository host configuration file.
pgBackRest repository host configuration include path.
pgBackRest repository host configuration path.
Repository host key file.
Repository host port when repo-host is set.
Repository host protocol type.
Repository host user when repo-host is set.
Path where backups and archive are stored.
Number of backups worth of continuous WAL to retain.
Backup type for WAL retention.
Number of differential backups to retain.
Full backup retention count/time.
Retention type for full backups.
Days of backup history manifests to retain.
S3 repository bucket.
S3 repository endpoint.
S3 repository access key.
S3 repository secret access key.
S3 repository key type.
S3 repository KMS key.
S3 repository region.
S3 repository role.
S3 repository security token.
S3 URI Style.
SFTP repository host.
SFTP repository host fingerprint.
SFTP host key check type.
SFTP repository host key hash type.
SFTP repository host port.
SFTP repository host user.
SFTP known hosts file.
SFTP private key file.
SFTP private key passphrase.
SFTP public key file.
Repository storage CA file.
Repository storage CA path.
Repository storage host.
Repository storage port.
Repository storage tag(s).
Repository storage upload chunk size.
Repository storage certificate verify.
Type of storage used for the repository.

Restore Options:

Preserve or disable archiving on restored cluster.
Restore excluding the specified databases.
Restore only specified databases.
Force a restore.
Restore all symlinks.
Modify the destination of a symlink.
Set an option in postgresql.auto.conf or recovery.conf.
Backup set to restore.
Restore a tablespace into the specified directory.
Restore all tablespaces into the specified directory.
Recovery target.
Action to take when recovery target is reached.
Stop just before the recovery target is reached.
Recover along a timeline.
Recovery type.

Server Options:

TLS server address.
TLS server authorized clients.
TLS server certificate authorities.
TLS server certificate file.
TLS server key file.
TLS server port.

Stanza Options:

PostgreSQL database.
PostgreSQL host for operating remotely.
PostgreSQL host certificate authority file.
PostgreSQL host certificate authority path.
PostgreSQL host certificate file.
PostgreSQL host pgBackRest command.
pgBackRest database host configuration file.
pgBackRest database host configuration include path.
pgBackRest database host configuration path.
PostgreSQL host key file.
PostgreSQL host port when pg-host is set.
PostgreSQL host protocol type.
PostgreSQL host logon user when pg-host is set.
PostgreSQL data directory.
PostgreSQL port.
PostgreSQL unix socket path.
PostgreSQL database user.

Stanza-create Options:

Create on an online cluster.

Stanza-delete Options:

Force stanza delete.

Stanza-upgrade Options:

Update an online cluster.

Stop Options:

Force all pgBackRest processes to stop.

Verify Options:

Output type.
Verbose output.

FILES

/etc/pgbackrest/pgbackrest.conf /var/lib/pgbackrest /var/log/pgbackrest /var/spool/pgbackrest /tmp/pgbackrest

EXAMPLES

Create a backup of the PostgreSQL `main` cluster:


$ pgbackrest --stanza=main backup
The `main` cluster should be configured in `/etc/pgbackrest/pgbackrest.conf`
Show all available backups:


$ pgbackrest info
Show all available backups for a specific cluster:


$ pgbackrest --stanza=main info
Show backup specific options:


$ pgbackrest help backup

SEE ALSO

/usr/share/doc/pgbackrest-doc/html/index.html http://www.pgbackrest.org

24 March 2024