pgbackrest(1)

NAME
pgBackRest - Reliable PostgreSQL Backup & Restore

SYNOPSIS
pgbackrest [options] [command]

DESCRIPTION
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.

COMMANDS

archive-get
    Get a WAL segment from the archive.

archive-push
    Push a WAL segment to the archive.

backup
    Backup a database cluster.

check
    Check the configuration.

expire
    Expire backups that exceed retention.

help
    Get help.

info
    Retrieve information about backups.

restore
    Restore a database cluster.

stanza-create
    Create the required stanza data.

stanza-upgrade
    Upgrade a stanza.

start
    Allow pgBackRest processes to run.

stop
    Stop pgBackRest processes from running.

version
    Get version.

OPTIONS
Archive Options:

    --archive-async
        Archive WAL segments asynchronously. [default=n]

    --archive-queue-max
        Limit size (in bytes) of the PostgreSQL archive queue.

    --archive-timeout
        Archive timeout. [default=60]

Backup Options:

    --archive-check
        Check that WAL segments are present in the archive before backup completes. [default=y]

    --archive-copy
        Copy WAL segments needed for consistency to the backup. [default=n]

    --backup-standby
        Backup from the standby cluster. [default=n]

    --checksum-page
        Validate data page checksums.

    --force
        Force an offline backup. [default=n]

    --hardlink
        Hardlink files between backups. [default=n]

    --manifest-save-threshold
        Manifest save threshold during backup. [default=1073741824]

    --online
        Perform an online backup. [default=y]

    --resume
        Allow resume of failed backup. [default=y]

    --start-fast
        Force a checkpoint to start backup quickly. [default=n]

    --stop-auto
        Stop prior failed backup on new backup. [default=n]

    --type
        Backup type. [default=incr]

Check Options:

    --online
        Check an online cluster. [default=y]

Expire Options:

    --retention-archive
        Number of backups worth of continuous WAL to retain.

    --retention-archive-type
        Backup type for WAL retention. [default=full]

    --retention-diff
        Number of differential backups to retain.

    --retention-full
        Number of full backups to retain.

General Options:

    --buffer-size
        Buffer size for file operations. [default=4194304]

    --cmd-ssh
        Path to ssh client executable. [default=ssh]

    --compress
        Use gzip file compression. [default=y]

    --compress-level
        Compression level for stored files. [default=6]

    --compress-level-network
        Compression level for network transfer when compress=n. [default=3]

    --config
        pgBackRest configuration file. [default=/etc/pgbackrest.conf]

    --db-timeout
        Database query timeout. [default=1800]

    --lock-path
        Path where lock files are stored. [default=/tmp/pgbackrest]

    --neutral-umask
        Use a neutral umask. [default=y]

    --process-max
        Max processes to use for compress/transfer. [default=1]

    --protocol-timeout
        Protocol timeout. [default=1830]

    --spool-path
        Path where WAL segments are spooled during async archiving. [default=/var/spool/pgbackrest]

    --stanza
        Defines the stanza.

Info Options:

    --output
        Output format. [default=text]

Log Options:

    --log-level-console
        Level for console logging. [default=warn]

    --log-level-file
        Level for file logging. [default=info]

    --log-level-stderr
        Level for stderr logging. [default=warn]

    --log-path
        Path where log files are stored. [default=/var/log/pgbackrest]

    --log-timestamp
        Enable timestamp in logging. [default=y]

Repository Options:

    --backup-cmd
        pgBackRest exe path on the backup host.

    --backup-config
        pgBackRest backup host configuration file. [default=/etc/pgbackrest.conf]

    --backup-host
        Backup host when operating remotely via SSH.

    --backup-ssh-port
        Backup server SSH port when backup-host is set.

    --backup-user
        Backup host user when backup-host is set. [default=backrest]

    --repo-path
        Repository path where WAL segments and backups stored. [default=/var/lib/pgbackrest]

    --repo-s3-bucket
        S3 repository bucket.

    --repo-s3-ca-file
        S3 SSL CA File.

    --repo-s3-ca-path
        S3 SSL CA Path.

    --repo-s3-endpoint
        S3 repository endpoint.

    --repo-s3-host
        S3 repository host.

    --repo-s3-key
        S3 repository access key.

    --repo-s3-key-secret
        S3 repository secret access key.

    --repo-s3-region
        S3 repository region.

    --repo-s3-verify-ssl
        Verify S3 server certificate. [default=y]

    --repo-type
        Type of storage used for the repository. [default=posix]

Restore Options:

    --db-include
        Restore only specified databases.

    --delta
        Restore using delta. [default=n]

    --force
        Force a restore. [default=n]

    --link-all
        Restore all symlinks. [default=n]

    --link-map
        Modify the destination of a symlink.

    --recovery-option
        Set an option in recovery.conf.

    --set
        Backup set to restore. [default=latest]

    --tablespace-map
        Restore a tablespace into the specified directory.

    --tablespace-map-all
        Restore all tablespaces into the specified directory.

    --target
        Recovery target.

    --target-action
        Action to take when recovery target is reached. [default=pause]

    --target-exclusive
        Stop just before the recovery target is reached. [default=n]

    --target-timeline
        Recover along a timeline.

    --type
        Recovery type. [default=default]

Stanza Options:

    --db-cmd
        pgBackRest exe path on the database host.

    --db-config
        pgBackRest database host configuration file. [default=/etc/pgbackrest.conf]

    --db-host
        Cluster host for operating remotely via SSH.

    --db-path
        Cluster data directory.

    --db-port
        Cluster port. [default=5432]

    --db-socket-path
        Cluster unix socket path.

    --db-ssh-port
        Database server SSH port when db-host is set.

    --db-user
        Cluster host logon user when db-host is set. [default=postgres]

Stanza-create Options:

    --force
        Force stanza creation. [default=n]

    --online
        Create on an online cluster. [default=y]

Stanza-upgrade Options:

    --online
        Update an online cluster. [default=y]

Stop Options:

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

FILES

/etc/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.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