pgbackrest(1)
hey bestie! you're reading pgbackrest(1), the pgBackRest command reference ๐ I'm gonna spill all the tea on how to back up and restore PostgreSQL like a total boss ๐ no cap.
โจ 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. it's giving main character energy for your backups, periodt ๐
๐ฅ COMMANDS ๐ฅ
annotateโ add or modify a backup annotation, bestie ๐archive-getโ grab a WAL segment from the archive โจarchive-pushโ push a WAL segment to the archive ๐backupโ back up a database cluster, no cap ๐checkโ check your configuration, periodt โexpireโ expire backups that exceed retention, bye ๐helpโ get help, we love that ๐ซถinfoโ retrieve information about backups, iykyk ๐repo-getโ get a file from a repository ๐repo-lsโ list files in a repository ๐restoreโ restore a database cluster, slay ๐serverโ pgBackRest server, the main character ๐server-pingโ ping pgBackRest server ๐stanza-createโ create the required stanza data โจstanza-deleteโ delete a stanza, bye felicia ๐stanza-upgradeโ upgrade a stanza, glow up ๐ซstartโ allow pgBackRest processes to run, go off ๐ฅstopโ stop pgBackRest processes from running, not today ๐verifyโ verify contents of a repository, fact check ๐versionโ get version, what's the vibe ๐
๐ OPTIONS ๐
๐ Annotate Options ๐
--setโ the backup set to annotate, bestie ๐
๐ Archive Options ๐
--archive-asyncโ push or get WAL segments asynchronously, no cap โจ--archive-get-queue-maxโ max size of the pgBackRest archive-get queue, fr fr ๐ฆ--archive-missing-retryโ retry missing WAL segment, we try again ๐ช--archive-push-batch-sizeโ max amount of WAL to push per asynchronous run, batch it ๐--archive-push-queue-maxโ max size of the PostgreSQL archive queue, queue it up ๐งต--archive-timeoutโ archive timeout, tick tock โฐ
๐ Backup Options ๐
--annotationโ annotate backup with user-defined key/value pairs, add your own tags ๐ท๏ธ--archive-checkโ check that WAL segments are in the archive before backup completes, verify it โ--archive-copyโ copy WAL segments needed for consistency to the backup, keep it consistent ๐พ--archive-mode-checkโ check the PostgreSQL archive_mode setting, check the vibe ๐--backup-standbyโ backup from the standby cluster, standby slay ๐--checksum-pageโ validate data page checksums, check those sums ๐งฎ--excludeโ exclude paths/files from the backup, no thanks ๐--expire-autoโ automatically run the expire command after a successful backup, auto-expire โจ--forceโ force an offline backup, do it anyway ๐ช--manifest-save-thresholdโ manifest save threshold during backup, save that manifest ๐--onlineโ perform an online backup, online era ๐--resumeโ allow resume of failed backup, pick up where you left off ๐--start-fastโ force a checkpoint to start backup quickly, fast start ๐--typeโ backup type, what type of backup? ๐ค
๐ Expire Options ๐
--archive-expire-beforeโ remove WAL archive earlier than the specified WAL segment, expire before ๐๏ธ--oldestโ expire the oldest eligible backup set, oldest out ๐ต--setโ the backup set to expire, bye set ๐
๐ General Options ๐
--allow-rootโ allow the command to run as the root user, root access iykyk ๐--buffer-sizeโ buffer size for I/O operations, buffer it ๐ฆ--cmdโ pgBackRest command, the command ๐ฎ--cmd-sshโ SSH client command, ssh it ๐--compressโ use file compression, zip it ๐๏ธ--compress-levelโ file compression level, level up ๐--compress-level-networkโ network compression level, network compress ๐--compress-typeโ file compression type, type of compress ๐--configโ pgBackRest configuration file, config file ๐--config-include-pathโ path to additional pgBackRest configuration files, extra configs ๐--config-pathโ base path of pgBackRest configuration files, config home ๐--db-timeoutโ database query timeout, timeout for db โณ--deltaโ restore or backup using checksums, delta it ๐--dry-runโ execute a dry-run for the command, test run ๐งช--io-timeoutโ I/O timeout, timeout for io โฐ--lock-pathโ path where lock files are stored, lock it up ๐--neutral-umaskโ use a neutral umask, neutral mask ๐ญ--priorityโ set process priority, priority level ๐--process-maxโ max processes to use for compress/transfer, max processes ๐--protocol-timeoutโ protocol timeout, timeout for protocol โฑ๏ธ--rawโ do not transform data, raw data ๐ฃ--sck-keep-aliveโ keep-alive enable, keep it alive ๐--spool-pathโ path where transient data is stored, spool path ๐๏ธ--stanzaโ defines the stanza, stanza vibes ๐ต--tcp-keep-alive-countโ keep-alive count, count it ๐ข--tcp-keep-alive-idleโ keep-alive idle time, idle time ๐ค--tcp-keep-alive-intervalโ keep-alive interval time, interval time โฒ๏ธ--tls-cipher-12โ allowed TLSv1.2 cipher suites, tls 1.2 ciphers ๐--tls-cipher-13โ allowed TLSv1.3 cipher suites, tls 1.3 ciphers ๐
๐ Help Options ๐
--helpโ display help, help me ๐--versionโ display version, version check ๐
๐ Info Options ๐
--detail-levelโ output detail level, detail level ๐--outputโ output format, output format ๐--setโ backup set to detail, detail that set ๐--typeโ filter on backup type, filter by type ๐ฏ
๐ Log Options ๐
--log-level-consoleโ level for console logging, console log level ๐ฅ๏ธ--log-level-fileโ level for file logging, file log level ๐--log-level-stderrโ level for stderr logging, stderr log level ๐จ--log-pathโ path where log files are stored, log path ๐--log-subprocessโ enable logging in subprocesses, log subprocesses ๐ถ--log-timestampโ enable timestamp in logging, timestamp it โฐ
๐ Maintainer Options ๐
--archive-header-checkโ check PostgreSQL version/id in WAL headers, check WAL headers ๐--page-header-checkโ check PostgreSQL page headers, check page headers ๐--pg-version-forceโ force PostgreSQL version, force version ๐ช
๐ Repo-get Options ๐
--ignore-missingโ ignore missing source file, ignore missing ๐ซ
๐ Repo-ls Options ๐
--filterโ filter output with a regular expression, filter it ๐--outputโ output format, output format ๐--recurseโ include all subpaths in output, recurse it ๐--sortโ sort output ascending, descending, or none, sort it ๐ข
๐ Repository Options ๐
--repoโ set repository, set repo ๐--repo-azure-accountโ Azure repository account, azure account โ๏ธ--repo-azure-containerโ Azure repository container, azure container ๐ฆ--repo-azure-endpointโ Azure repository endpoint, azure endpoint ๐--repo-azure-keyโ Azure repository key, azure key ๐--repo-azure-key-typeโ Azure repository key type, azure key type ๐๏ธ--repo-azure-uri-styleโ Azure URI Style, azure uri style ๐จ--repo-blockโ enable block incremental backup, block incremental ๐งฑ--repo-bundleโ bundle files in repository, bundle it ๐--repo-bundle-limitโ limit for file bundles, bundle limit ๐ง--repo-bundle-sizeโ target size for file bundles, bundle size ๐--repo-cipher-passโ repository cipher passphrase, cipher pass ๐--repo-cipher-typeโ cipher used to encrypt the repository, cipher type ๐--repo-gcs-bucketโ GCS repository bucket, gcs bucket ๐ชฃ--repo-gcs-endpointโ GCS repository endpoint, gcs endpoint ๐--repo-gcs-keyโ GCS repository key, gcs key ๐--repo-gcs-key-typeโ GCS repository key type, gcs key type ๐๏ธ--repo-gcs-user-projectโ GCS project ID, gcs project id ๐--repo-hardlinkโ hardlink files between backups in the repository, hardlink it ๐--repo-hostโ repository host when operating remotely, repo host remotely ๐--repo-host-ca-fileโ repository host certificate authority file, ca file ๐--repo-host-ca-pathโ repository host certificate authority path, ca path ๐--repo-host-cert-fileโ repository host certificate file, cert file ๐--repo-host-cmdโ repository host pgBackRest command, host command ๐ฎ--repo-host-configโ pgBackRest repository host configuration file, host config ๐--repo-host-config-include-pathโ pgBackRest repository host configuration include path, host config include path ๐--repo-host-config-pathโ pgBackRest repository host configuration path, host config path ๐--repo-host-key-fileโ repository host key file, host key file ๐--repo-host-portโ repository host port when repo-host is set, host port ๐ช--repo-host-typeโ repository host protocol type, host type ๐ฅ๏ธ--repo-host-userโ repository host user when repo-host is set, host user ๐ค--repo-pathโ path where backups and archive are stored, repo path ๐--repo-retention-archiveโ number of backups worth of continuous WAL to retain, retention archive ๐๏ธ--repo-retention-archive-typeโ backup type for WAL retention, retention archive type ๐๏ธ--repo-retention-diffโ number of differential backups to retain, retention diff ๐--repo-retention-fullโ full backup retention count/time, retention full ๐ฏ--repo-retention-full-typeโ retention type for full backups, retention full type ๐๏ธ--repo-retention-historyโ days of backup history manifests to retain, retention history ๐--repo-s3-bucketโ S3 repository bucket, s3 bucket ๐ชฃ--repo-s3-endpointโ S3 repository endpoint, s3 endpoint ๐--repo-s3-keyโ S3 repository access key, s3 access key ๐--repo-s3-key-secretโ S3 repository secret access key, s3 secret key ๐--repo-s3-key-typeโ S3 repository key type, s3 key type ๐๏ธ--repo-s3-kms-key-idโ S3 repository KMS key, s3 kms key ๐--repo-s3-process-cmdโ S3 authentication process command, s3 process cmd ๐ฎ--repo-s3-regionโ S3 repository region, s3 region ๐--repo-s3-requester-paysโ S3 repository requester pays, requester pays ๐ธ--repo-s3-roleโ S3 repository role, s3 role ๐--repo-s3-serviceโ S3 signing service, s3 service ๐ ๏ธ--repo-s3-sse-customer-keyโ S3 repository SSE customer key, sse customer key ๐--repo-s3-sts-hostโ S3 repository STS endpoint, sts host ๐
--repo-s3-tokenโ the security token for your S3 repo ๐ keep it secret, keep it safe--repo-s3-uri-styleโ the URI style for S3, so the repo knows how to talk to it โจ--repo-sftp-hostโ which host your SFTP repo lives on ๐ฅ๏ธ--repo-sftp-host-fingerprintโ the host fingerprint for that SFTP repo host ๐--repo-sftp-host-key-check-typeโ what kind of host key check you want for SFTP ๐ง--repo-sftp-host-key-hash-typeโ the hash type for the SFTP repo host key ๐--repo-sftp-host-portโ the port on the SFTP repo host ๐ช--repo-sftp-host-userโ the user logging into the SFTP repo host ๐ค--repo-sftp-known-hostโ your SFTP known hosts file ๐--repo-sftp-private-key-fileโ the SFTP private key file ๐๏ธ--repo-sftp-private-key-passphraseโ the passphrase for that private key ๐คซ--repo-sftp-public-key-fileโ the SFTP public key file that goes with it ๐--repo-storage-ca-fileโ the CA file for repo storage ๐--repo-storage-ca-pathโ the CA path for repo storage ๐ค๏ธ--repo-storage-hostโ the repo storage host ๐--repo-storage-portโ the repo storage port ๐ช--repo-storage-tagโ repo storage tag(s) ๐ท๏ธ--repo-storage-upload-chunk-sizeโ how big the upload chunks are when you push to repo storage ๐งฑ--repo-storage-verify-tlsโ whether to verify the repo storage certificate ๐โ--repo-symlinkโ create symlinks inside the repository ๐--repo-target-timeโ the target time for the repository โฐ--repo-typeโ the type of storage your repository uses ๐๏ธ
๐ Restore Options ๐
--archive-modeโ keep archiving on for the restored cluster, or turn it off ๐ฆ--db-excludeโ restore everything EXCEPT the databases you name ๐ โโ๏ธ--db-includeโ restore ONLY the databases you name ๐ฏ--forceโ force the restore ๐ช--link-allโ restore all the symlinks ๐--link-mapโ change where a symlink points ๐บ๏ธ--recovery-optionโ set an option over inpostgresql.auto.conforrecovery.confโ๏ธ--setโ which backup set to restore ๐ฆ--tablespace-mapโ restore one tablespace into the directory you choose ๐--tablespace-map-allโ restore every tablespace into the directory you choose ๐๐--targetโ the recovery target ๐ฏ--target-actionโ what to do the second the recovery target is reached ๐ฌ--target-exclusiveโ stop right before the recovery target is reached ๐--target-timelineโ recover along a timeline ๐ฐ๏ธ--typeโ the recovery type ๐
๐ฅ๏ธ Server Options ๐ฅ๏ธ
--tls-server-addressโ the TLS server address ๐--tls-server-authโ which clients the TLS server has authorized โ--tls-server-ca-fileโ the TLS server's certificate authorities ๐--tls-server-cert-fileโ the TLS server certificate file ๐ชช--tls-server-key-fileโ the TLS server key file ๐--tls-server-portโ the TLS server port ๐ช
๐ง Stanza Options ๐ง
--pg-databaseโ the PostgreSQL database ๐--pg-hostโ the PostgreSQL host, for when you're operating remotely ๐ฐ๏ธ--pg-host-ca-fileโ the certificate authority file for the PostgreSQL host ๐--pg-host-ca-pathโ the certificate authority path for the PostgreSQL host ๐ค๏ธ--pg-host-cert-fileโ the certificate file for the PostgreSQL host ๐ชช--pg-host-cmdโ the pgBackRest command to run on the PostgreSQL host ๐โโ๏ธ--pg-host-configโ the pgBackRest database host configuration file ๐--pg-host-config-include-pathโ the pgBackRest database host configuration include path ๐--pg-host-config-pathโ the pgBackRest database host configuration path ๐--pg-host-key-fileโ the key file for the PostgreSQL host ๐--pg-host-portโ the PostgreSQL host port, used whenpg-hostis set ๐ช--pg-host-typeโ the PostgreSQL host protocol type ๐--pg-host-userโ the logon user for the PostgreSQL host, used whenpg-hostis set ๐ค--pg-pathโ the PostgreSQL data directory ๐--pg-portโ the PostgreSQL port ๐ช--pg-socket-pathโ the PostgreSQL unix socket path ๐งฆ--pg-userโ the PostgreSQL database user ๐ค
โจ Stanza-create Options โจ
--onlineโ create the stanza on a cluster that's currently online ๐
๐๏ธ Stanza-delete Options ๐๏ธ
--forceโ force the stanza delete ๐ฅ
โฌ๏ธ Stanza-upgrade Options โฌ๏ธ
--onlineโ update a cluster that's online ๐
๐ Stop Options ๐
--forceโ force ALL the pgBackRest processes to stop ๐
๐ Verify Options ๐
--outputโ the output type ๐ค--setโ the backup set you're verifying ๐ฆ--verboseโ verbose output, bestie ๐ฃ๏ธ
๐ท๏ธ Version Options ๐ท๏ธ
--outputโ the output type ๐ค
๐ FILES ๐
These are the spots pgBackRest calls home ๐ก no cap:
/etc/pgbackrest/pgbackrest.conf/var/lib/pgbackrest/var/log/pgbackrest/var/spool/pgbackrest/tmp/pgbackrest
๐ EXAMPLES ๐
- Create a backup of the PostgreSQL
maincluster ๐พ:
$ 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.htmlhttps://pgbackrest.org
and that's the whole page, bestie ๐ซถ this is the pgbackrest(1) manual, dated 19 August 2026 โ go forth and back up literally everything, you icon ๐โจ
๐ฆ where this page comes from
- ubuntu stonking: pgbackrest 2.59.1-1 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms