pgBackRest(1) Reliable PostgreSQL Backup & Restore


pgbackrest [options] [command]


pgBackRest aims to be a simple, reliable backup and restore system that can seamlessly scale up to the largest databases and workloads.

Instead of relying on traditional backup tools like tar and rsync, pgBackRest implements all backup features internally and uses a custom protocol for communicating with remote systems. Removing reliance on tar and rsync allows for better solutions to database-specific backup challenges. The custom remote protocol allows for more flexibility and limits the types of connections that are required to perform a backup which increases security.


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.
Restore a database cluster.
Allow pgBackRest processes to run.
Stop pgBackRest processes from running.
Get version.


Archive Options:
Archive WAL segments asynchronously. [default=n]
Limit size of the local asynchronous archive queue when archive-async=y.

Backup Options:

Check that WAL segments are present in the archive before backup completes. [default=y]
Copy WAL segments needed for consistency to the backup. [default=n]
Backup host when operating remotely via SSH.
Backup host user when backup-host is set. [default=backrest]
Force an offline backup. [default=n]
Hardlink files between backups. [default=n]
Manifest save threshold during backup. [default=1073741824]
Allow resume of failed backup. [default=y]
Force a checkpoint to start backup quickly. [default=n]
Stop prior failed backup on new backup. [default=n]
Backup type. [default=incr]

Command Options:

pgBackRest exe path on the remote host. [default=/build/pgbackrest-1.03/doc/]

Expire Options:

Number of backups worth of WAL to retain.
Backup type for WAL retention. [default=full]
Number of differential backups to retain.
Number of full backups to retain.

General Options:

Archive timeout. [default=60]
Buffer size for file operations. [default=4194304]
Use gzip file compression. [default=y]
Compression level for stored files. [default=6]
Compression level for network transfer when compress=n. [default=3]
pgBackRest configuration file. [default=/etc/pgbackrest.conf]
pgBackRest remote configuration file. [default=/etc/pgbackrest.conf]
Database query timeout. [default=1800]
Path where lock files are stored. [default=/tmp/pgbackrest]
Path where log files are stored. [default=/var/log/pgbackrest]
Use a neutral umask. [default=y]
Perform an online backup. [default=y]
Protocol timeout. [default=1830]
Repository path where WAL segments and backups stored. [default=/var/lib/pgbackrest]
Path where WAL segments are spooled during async archiving. [default=/var/spool/pgbackrest]
Command stanza.
Max threads to use in process. [default=1]
Max time a thread can run.

Info Options:

Output format. [default=text]

Log Options:

Level for console logging. [default=warn]
Level for file logging. [default=info]

Restore Options:

Restore only specified databases.
Restore using delta. [default=n]
Force a restore. [default=n]
Restore all symlinks. [default=n]
Modify the destination of a symlink.
Create a lock so restores on a stanza cannot run simultaneously. [default=y]
Set an option in recovery.conf.
Backup set to restore. [default=latest]
Restore a tablespace into the specified directory.
Restore all tablespaces into the specified directory.
Recovery target.
Action to take when recovery target is reached. [default=pause]
Stop just before the recovery target is reached. [default=n]
Recover along a timeline.
Recovery type. [default=default]

Stanza Options:

Cluster host for operating remotely via SSH.
Cluster data directory.
Cluster port. [default=5432]
Cluster unix socket path.
Cluster host logon user when db-host is set. [default=postgres]

Stop Options:

Force all pgBackRest processes to stop. [default=n]


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


  • Create a backup of the PostgreSQL `main` cluster:

    $ pgbackrest --stanza=main backup
    The `main` cluster should be configured in `/etc/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