.\" Text automatically generated by txt2man .TH pgbackrest 1 "02 June 2023" "" "pgBackRest Command Reference" .SH NAME \fBpgBackRest \fP- Reliable PostgreSQL Backup & Restore \fB .SH SYNOPSIS .nf .fam C \fBpgbackrest\fP [\fIoptions\fP] [\fIcommand\fP] .fam T .fi .fam T .fi .SH DESCRIPTION pgBackRest aims to be a reliable, easy-to-use backup and restore solution that can seamlessly scale up to the largest databases and workloads by utilizing algorithms that are optimized for database-specific requirements. .SH COMMANDS .TP .B annotate Add or modify backup annotation. .TP .B archive-get Get a WAL segment from the archive. .TP .B archive-push Push a WAL segment to the archive. .TP .B backup Backup a database cluster. .TP .B check Check the configuration. .TP .B expire Expire backups that exceed retention. .TP .B help Get help. .TP .B info Retrieve information about backups. .TP .B repo-get Get a file from a repository. .TP .B repo-ls List files in a repository. .TP .B restore Restore a database cluster. .TP .B server pgBackRest server. .TP .B server-ping Ping pgBackRest server. .TP .B stanza-create Create the required stanza data. .TP .B stanza-delete Delete a stanza. .TP .B stanza-upgrade Upgrade a stanza. .TP .B start Allow pgBackRest processes to run. .TP .B stop Stop pgBackRest processes from running. .TP .B verify Verify contents of the repository. .TP .B version Get version. .SH OPTIONS Annotate Options: .RS .TP .B \fB--set\fP Backup set to annotate. .RE .PP Archive Options: .RS .TP .B \fB--archive-async\fP Push/get WAL segments asynchronously. [default=n] .TP .B \fB--archive-get-queue-max\fP Maximum size of the pgBackRest archive-get queue. [default=128MiB] .TP .B \fB--archive-header-check\fP Check PostgreSQL version/id in WAL headers. [default=y] .TP .B \fB--archive-missing-retry\fP Retry missing WAL segment [default=y] .TP .B \fB--archive-push-queue-max\fP Maximum size of the PostgreSQL archive queue. .TP .B \fB--archive-timeout\fP Archive timeout. [default=60] .RE .PP Backup Options: .RS .TP .B \fB--annotation\fP Annotate backup with user-defined key/value pairs. .TP .B \fB--archive-check\fP Check that WAL segments are in the archive before backup completes. [default=y] .TP .B \fB--archive-copy\fP Copy WAL segments needed for consistency to the backup. [default=n] .TP .B \fB--archive-mode-check\fP Check the PostgreSQL archive_mode setting. [default=y] .TP .B \fB--backup-standby\fP Backup from the standby cluster. [default=n] .TP .B \fB--checksum-page\fP Validate data page checksums. .TP .B \fB--exclude\fP Exclude paths/files from the backup. .TP .B \fB--expire-auto\fP Automatically run the expire \fIcommand\fP after a successful backup. [default=y] .TP .B \fB--force\fP Force an offline backup. [default=n] .TP .B \fB--manifest-save-threshold\fP Manifest save threshold during backup. [default=1GiB] .TP .B \fB--online\fP Perform an online backup. [default=y] .TP .B \fB--page-header-check\fP Check PostgreSQL page headers. [default=y] .TP .B \fB--resume\fP Allow resume of failed backup. [default=y] .TP .B \fB--start-fast\fP Force a checkpoint to start backup quickly. [default=n] .TP .B \fB--stop-auto\fP Stop prior failed backup on new backup. [default=n] .TP .B \fB--type\fP Backup type. [default=incr] .RE .PP Expire Options: .RS .TP .B \fB--set\fP Backup set to expire. .RE .PP General Options: .RS .TP .B \fB--buffer-size\fP Buffer size for I/O operations. [default=1MiB] .TP .B \fB--cmd\fP pgBackRest \fIcommand\fP. .TP .B \fB--cmd-ssh\fP SSH client \fIcommand\fP. [default=ssh] .TP .B \fB--compress\fP Use file compression. [default=y] .TP .B \fB--compress-level\fP File compression level. .TP .B \fB--compress-level-network\fP Network compression level. [default=3] .TP .B \fB--compress-type\fP File compression type. [default=gz] .TP .B \fB--config\fP pgBackRest configuration file. [default=CFGOPTDEF_CONFIG_PATH "/" PROJECT_CONFIG_FILE] .TP .B \fB--config-include-path\fP Path to additional pgBackRest configuration files. [default=CFGOPTDEF_CONFIG_PATH "/" PROJECT_CONFIG_INCLUDE_PATH] .TP .B \fB--config-path\fP Base path of pgBackRest configuration files. [default=CFGOPTDEF_CONFIG_PATH] .TP .B \fB--db-timeout\fP Database query timeout. [default=1800] .TP .B \fB--delta\fP Restore or backup using checksums. [default=n] .TP .B \fB--dry-run\fP Execute a dry-run for the \fIcommand\fP. [default=n] .TP .B \fB--io-timeout\fP I/O timeout. [default=60] .TP .B \fB--lock-path\fP Path where lock files are stored. [default=/tmp/\fBpgbackrest\fP] .TP .B \fB--neutral-umask\fP Use a neutral umask. [default=y] .TP .B \fB--process-max\fP Max processes to use for compress/transfer. [default=1] .TP .B \fB--protocol-timeout\fP Protocol timeout. [default=1830] .TP .B \fB--raw\fP Do not transform data. [default=n] .TP .B \fB--sck-keep-alive\fP Keep-alive enable. [default=y] .TP .B \fB--spool-path\fP Path where transient data is stored. [default=/var/spool/\fBpgbackrest\fP] .TP .B \fB--stanza\fP Defines the stanza. .TP .B \fB--tcp-keep-alive-count\fP Keep-alive count. .TP .B \fB--tcp-keep-alive-idle\fP Keep-alive idle time. .TP .B \fB--tcp-keep-alive-interval\fP Keep-alive interval time. .RE .PP Info Options: .RS .TP .B \fB--output\fP Output format. [default=text] .TP .B \fB--set\fP Backup set to detail. .TP .B \fB--type\fP Filter on backup type. .RE .PP Log Options: .RS .TP .B \fB--log-level-console\fP Level for console logging. [default=warn] .TP .B \fB--log-level-file\fP Level for file logging. [default=info] .TP .B \fB--log-level-stderr\fP Level for stderr logging. [default=warn] .TP .B \fB--log-path\fP Path where log files are stored. [default=/var/log/\fBpgbackrest\fP] .TP .B \fB--log-subprocess\fP Enable logging in subprocesses. [default=n] .TP .B \fB--log-timestamp\fP Enable timestamp in logging. [default=y] .RE .PP Repo-get Options: .RS .TP .B \fB--ignore-missing\fP Ignore missing source file. [default=n] .RE .PP Repo-ls Options: .RS .TP .B \fB--filter\fP Filter output with a regular expression. .TP .B \fB--output\fP Output format. [default=text] .TP .B \fB--recurse\fP Include all subpaths in output. [default=n] .TP .B \fB--sort\fP Sort output ascending, descending, or none. [default=asc] .RE .PP Repository Options: .RS .TP .B \fB--repo\fP Set repository. .TP .B \fB--repo-azure-account\fP Azure repository account. .TP .B \fB--repo-azure-container\fP Azure repository container. .TP .B \fB--repo-azure-endpoint\fP Azure repository endpoint. [default=blob.core.windows.net] .TP .B \fB--repo-azure-key\fP Azure repository key. .TP .B \fB--repo-azure-key-type\fP Azure repository key type. [default=shared] .TP .B \fB--repo-azure-uri-style\fP Azure URI Style. [default=host] .TP .B \fB--repo-block\fP Enable block incremental backup. [default=n] .TP .B \fB--repo-bundle\fP Bundle files in repository. [default=n] .TP .B \fB--repo-bundle-limit\fP Limit for file bundles. [default=2MiB] .TP .B \fB--repo-bundle-size\fP Target size for file bundles. [default=20MiB] .TP .B \fB--repo-cipher-pass\fP Repository cipher passphrase. .TP .B \fB--repo-cipher-type\fP Cipher used to encrypt the repository. [default=none] .TP .B \fB--repo-gcs-bucket\fP GCS repository bucket. .TP .B \fB--repo-gcs-endpoint\fP GCS repository endpoint. [default=storage.googleapis.com] .TP .B \fB--repo-gcs-key\fP GCS repository key. .TP .B \fB--repo-gcs-key-type\fP GCS repository key type. [default=service] .TP .B \fB--repo-hardlink\fP Hardlink files between backups in the repository. [default=n] .TP .B \fB--repo-host\fP Repository host when operating remotely. .TP .B \fB--repo-host-ca-file\fP Repository host certificate authority file. .TP .B \fB--repo-host-ca-path\fP Repository host certificate authority path. .TP .B \fB--repo-host-cert-file\fP Repository host certificate file. .TP .B \fB--repo-host-cmd\fP Repository host pgBackRest \fIcommand\fP. .TP .B \fB--repo-host-config\fP pgBackRest repository host configuration file. [default=CFGOPTDEF_CONFIG_PATH "/" PROJECT_CONFIG_FILE] .TP .B \fB--repo-host-config-include-path\fP pgBackRest repository host configuration include path. [default=CFGOPTDEF_CONFIG_PATH "/" PROJECT_CONFIG_INCLUDE_PATH] .TP .B \fB--repo-host-config-path\fP pgBackRest repository host configuration path. [default=CFGOPTDEF_CONFIG_PATH] .TP .B \fB--repo-host-key-file\fP Repository host key file. .TP .B \fB--repo-host-port\fP Repository host port when repo-host is set. .TP .B \fB--repo-host-type\fP Repository host protocol type. [default=ssh] .TP .B \fB--repo-host-user\fP Repository host user when repo-host is set. [default=\fBpgbackrest\fP] .TP .B \fB--repo-path\fP Path where backups and archive are stored. [default=/var/lib/\fBpgbackrest\fP] .TP .B \fB--repo-retention-archive\fP Number of backups worth of continuous WAL to retain. .TP .B \fB--repo-retention-archive-type\fP Backup type for WAL retention. [default=full] .TP .B \fB--repo-retention-diff\fP Number of differential backups to retain. .TP .B \fB--repo-retention-full\fP Full backup retention count/time. .TP .B \fB--repo-retention-full-type\fP Retention type for full backups. [default=count] .TP .B \fB--repo-retention-history\fP Days of backup history manifests to retain. .TP .B \fB--repo-s3-bucket\fP S3 repository bucket. .TP .B \fB--repo-s3-endpoint\fP S3 repository endpoint. .TP .B \fB--repo-s3-key\fP S3 repository access key. .TP .B \fB--repo-s3-key-secret\fP S3 repository secret access key. .TP .B \fB--repo-s3-key-type\fP S3 repository key type. [default=shared] .TP .B \fB--repo-s3-kms-key-id\fP S3 repository KMS key. .TP .B \fB--repo-s3-region\fP S3 repository region. .TP .B \fB--repo-s3-role\fP S3 repository role. .TP .B \fB--repo-s3-token\fP S3 repository security token. .TP .B \fB--repo-s3-uri-style\fP S3 URI Style. [default=host] .TP .B \fB--repo-sftp-host\fP SFTP repository host. .TP .B \fB--repo-sftp-host-fingerprint\fP SFTP repository host fingerprint. .TP .B \fB--repo-sftp-host-key-hash-type\fP SFTP repository host key hash type. .TP .B \fB--repo-sftp-host-port\fP SFTP repository host port. [default=22] .TP .B \fB--repo-sftp-host-user\fP SFTP repository host user. .TP .B \fB--repo-sftp-private-key-file\fP SFTP private key file. .TP .B \fB--repo-sftp-private-key-passphrase\fP SFTP private key passphrase. .TP .B \fB--repo-sftp-public-key-file\fP SFTP public key file. .TP .B \fB--repo-storage-ca-file\fP Repository storage CA file. .TP .B \fB--repo-storage-ca-path\fP Repository storage CA path. .TP .B \fB--repo-storage-host\fP Repository storage host. .TP .B \fB--repo-storage-port\fP Repository storage port. [default=443] .TP .B \fB--repo-storage-upload-chunk-size\fP Repository storage upload chunk size. .TP .B \fB--repo-storage-verify-tls\fP Repository storage certificate verify. [default=y] .TP .B \fB--repo-type\fP Type of storage used for the repository. [default=posix] .RE .PP Restore Options: .RS .TP .B \fB--archive-mode\fP Preserve or disable archiving on restored cluster. [default=preserve] .TP .B \fB--db-exclude\fP Restore excluding the specified databases. .TP .B \fB--db-include\fP Restore only specified databases. .TP .B \fB--force\fP Force a restore. [default=n] .TP .B \fB--link-all\fP Restore all symlinks. [default=n] .TP .B \fB--link-map\fP Modify the destination of a symlink. .TP .B \fB--recovery-option\fP Set an option in recovery.conf. .TP .B \fB--set\fP Backup set to restore. [default=latest] .TP .B \fB--tablespace-map\fP Restore a tablespace into the specified directory. .TP .B \fB--tablespace-map-all\fP Restore all tablespaces into the specified directory. .TP .B \fB--target\fP Recovery target. .TP .B \fB--target-action\fP Action to take when recovery target is reached. [default=pause] .TP .B \fB--target-exclusive\fP Stop just before the recovery target is reached. [default=n] .TP .B \fB--target-timeline\fP Recover along a timeline. .TP .B \fB--type\fP Recovery type. [default=default] .RE .PP Server Options: .RS .TP .B \fB--tls-server-address\fP TLS server address. [default=localhost] .TP .B \fB--tls-server-auth\fP TLS server authorized clients. .TP .B \fB--tls-server-ca-file\fP TLS server certificate authorities. .TP .B \fB--tls-server-cert-file\fP TLS server certificate file. .TP .B \fB--tls-server-key-file\fP TLS server key file. .TP .B \fB--tls-server-port\fP TLS server port. [default=8432] .RE .PP Stanza Options: .RS .TP .B \fB--pg-database\fP PostgreSQL database. [default=postgres] .TP .B \fB--pg-host\fP PostgreSQL host for operating remotely. .TP .B \fB--pg-host-ca-file\fP PostgreSQL host certificate authority file. .TP .B \fB--pg-host-ca-path\fP PostgreSQL host certificate authority path. .TP .B \fB--pg-host-cert-file\fP PostgreSQL host certificate file. .TP .B \fB--pg-host-cmd\fP PostgreSQL host pgBackRest \fIcommand\fP. .TP .B \fB--pg-host-config\fP pgBackRest database host configuration file. [default=CFGOPTDEF_CONFIG_PATH "/" PROJECT_CONFIG_FILE] .TP .B \fB--pg-host-config-include-path\fP pgBackRest database host configuration include path. [default=CFGOPTDEF_CONFIG_PATH "/" PROJECT_CONFIG_INCLUDE_PATH] .TP .B \fB--pg-host-config-path\fP pgBackRest database host configuration path. [default=CFGOPTDEF_CONFIG_PATH] .TP .B \fB--pg-host-key-file\fP PostgreSQL host key file. .TP .B \fB--pg-host-port\fP PostgreSQL host port when pg-host is set. .TP .B \fB--pg-host-type\fP PostgreSQL host protocol type. [default=ssh] .TP .B \fB--pg-host-user\fP PostgreSQL host logon user when pg-host is set. [default=postgres] .TP .B \fB--pg-path\fP PostgreSQL data directory. .TP .B \fB--pg-port\fP PostgreSQL port. [default=5432] .TP .B \fB--pg-socket-path\fP PostgreSQL unix socket path. .TP .B \fB--pg-user\fP PostgreSQL database user. .RE .PP Stanza-create Options: .RS .TP .B \fB--online\fP Create on an online cluster. [default=y] .RE .PP Stanza-delete Options: .RS .TP .B \fB--force\fP Force stanza delete. [default=n] .RE .PP Stanza-upgrade Options: .RS .TP .B \fB--online\fP Update an online cluster. [default=y] .RE .PP Stop Options: .RS .TP .B \fB--force\fP Force all pgBackRest processes to stop. [default=n] .RE .PP Verify Options: .RS .TP .B \fB--output\fP Output type. [default=none] .TP .B \fB--verbose\fP Verbose output. [default=n] .SH FILES CFGOPTDEF_CONFIG_PATH "/" PROJECT_CONFIG_FILE /var/lib/\fBpgbackrest\fP /var/log/\fBpgbackrest\fP /var/spool/\fBpgbackrest\fP /tmp/\fBpgbackrest\fP .SH EXAMPLES .IP \(bu 3 Create a backup of the PostgreSQL `main` cluster: .PP .nf .fam C $ pgbackrest --stanza=main backup The `main` cluster should be configured in `CFGOPTDEF_CONFIG_PATH "/" PROJECT_CONFIG_FILE` .fam T .fi .IP \(bu 3 Show all available backups: .PP .nf .fam C $ pgbackrest info .fam T .fi .IP \(bu 3 Show all available backups for a specific cluster: .PP .nf .fam C $ pgbackrest --stanza=main info .fam T .fi .IP \(bu 3 Show backup specific \fIoptions\fP: .PP .nf .fam C $ pgbackrest help backup .fam T .fi .SH SEE ALSO /usr/share/doc/\fBpgbackrest\fP-doc/html/index.html http://www.pgbackrest.org