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¶
- annotate
- Add or modify backup annotation.
- 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.
- repo-get
- Get a file from a repository.
- repo-ls
- List files in a repository.
- restore
- Restore a database cluster.
- server
- pgBackRest server.
- server-ping
- Ping pgBackRest server.
- stanza-create
- Create the required stanza data.
- stanza-delete
- Delete a stanza.
- stanza-upgrade
- Upgrade a stanza.
- start
- Allow pgBackRest processes to run.
- stop
- Stop pgBackRest processes from running.
- verify
- Verify contents of the repository.
- version
- Get version.
OPTIONS¶
Annotate Options:
- --set
- Backup set to annotate.
Archive Options:
- --archive-async
- Push/get WAL segments asynchronously.
- --archive-get-queue-max
- Maximum size of the pgBackRest archive-get queue.
- --archive-missing-retry
- Retry missing WAL segment
- --archive-push-queue-max
- Maximum size of the PostgreSQL archive queue.
- --archive-timeout
- Archive timeout.
Backup Options:
- --annotation
- Annotate backup with user-defined key/value pairs.
- --archive-check
- Check that WAL segments are in the archive before backup completes.
- --archive-copy
- Copy WAL segments needed for consistency to the backup.
- --archive-mode-check
- Check the PostgreSQL archive_mode setting.
- --backup-standby
- Backup from the standby cluster.
- --checksum-page
- Validate data page checksums.
- --exclude
- Exclude paths/files from the backup.
- --expire-auto
- Automatically run the expire command after a successful backup.
- --force
- Force an offline backup.
- --manifest-save-threshold
- Manifest save threshold during backup.
- --online
- Perform an online backup.
- --resume
- Allow resume of failed backup.
- --start-fast
- Force a checkpoint to start backup quickly.
- --stop-auto
- Stop prior failed backup on new backup.
- --type
- Backup type.
Expire Options:
- --set
- Backup set to expire.
General Options:
- --buffer-size
- Buffer size for I/O operations.
- --cmd
- pgBackRest command.
- --cmd-ssh
- SSH client command.
- --compress
- Use file compression.
- --compress-level
- File compression level.
- --compress-level-network
- Network compression level.
- --compress-type
- File compression type.
- --config
- pgBackRest configuration file.
- --config-include-path
- Path to additional pgBackRest configuration files.
- --config-path
- Base path of pgBackRest configuration files.
- --db-timeout
- Database query timeout.
- --delta
- Restore or backup using checksums.
- --dry-run
- Execute a dry-run for the command.
- --io-timeout
- I/O timeout.
- --lock-path
- Path where lock files are stored.
- --neutral-umask
- Use a neutral umask.
- --process-max
- Max processes to use for compress/transfer.
- --protocol-timeout
- Protocol timeout.
- --raw
- Do not transform data.
- --sck-keep-alive
- Keep-alive enable.
- --spool-path
- Path where transient data is stored.
- --stanza
- Defines the stanza.
- --tcp-keep-alive-count
- Keep-alive count.
- --tcp-keep-alive-idle
- Keep-alive idle time.
- --tcp-keep-alive-interval
- Keep-alive interval time.
Info Options:
Log Options:
- --log-level-console
- Level for console logging.
- --log-level-file
- Level for file logging.
- --log-level-stderr
- Level for stderr logging.
- --log-path
- Path where log files are stored.
- --log-subprocess
- Enable logging in subprocesses.
- --log-timestamp
- Enable timestamp in logging.
Maintainer Options:
- --archive-header-check
- Check PostgreSQL version/id in WAL headers.
- --page-header-check
- Check PostgreSQL page headers.
- --pg-version-force
- Force PostgreSQL version.
Repo-get Options:
- --ignore-missing
- Ignore missing source file.
Repo-ls Options:
Repository Options:
- --repo
- Set repository.
- --repo-azure-account
- Azure repository account.
- --repo-azure-container
- Azure repository container.
- --repo-azure-endpoint
- Azure repository endpoint.
- --repo-azure-key
- Azure repository key.
- --repo-azure-key-type
- Azure repository key type.
- --repo-azure-uri-style
- Azure URI Style.
- --repo-block
- Enable block incremental backup.
- --repo-bundle
- Bundle files in repository.
- --repo-bundle-limit
- Limit for file bundles.
- --repo-bundle-size
- Target size for file bundles.
- --repo-cipher-pass
- Repository cipher passphrase.
- --repo-cipher-type
- Cipher used to encrypt the repository.
- --repo-gcs-bucket
- GCS repository bucket.
- --repo-gcs-endpoint
- GCS repository endpoint.
- --repo-gcs-key
- GCS repository key.
- --repo-gcs-key-type
- GCS repository key type.
- --repo-hardlink
- Hardlink files between backups in the repository.
- --repo-host
- Repository host when operating remotely.
- --repo-host-ca-file
- Repository host certificate authority file.
- --repo-host-ca-path
- Repository host certificate authority path.
- --repo-host-cert-file
- Repository host certificate file.
- --repo-host-cmd
- Repository host pgBackRest command.
- --repo-host-config
- pgBackRest repository host configuration file.
- --repo-host-config-include-path
- pgBackRest repository host configuration include path.
- --repo-host-config-path
- pgBackRest repository host configuration path.
- --repo-host-key-file
- Repository host key file.
- --repo-host-port
- Repository host port when repo-host is set.
- --repo-host-type
- Repository host protocol type.
- --repo-host-user
- Repository host user when repo-host is set.
- --repo-path
- Path where backups and archive are stored.
- --repo-retention-archive
- Number of backups worth of continuous WAL to retain.
- --repo-retention-archive-type
- Backup type for WAL retention.
- --repo-retention-diff
- Number of differential backups to retain.
- --repo-retention-full
- Full backup retention count/time.
- --repo-retention-full-type
- Retention type for full backups.
- --repo-retention-history
- Days of backup history manifests to retain.
- --repo-s3-bucket
- S3 repository bucket.
- --repo-s3-endpoint
- S3 repository endpoint.
- --repo-s3-key
- S3 repository access key.
- --repo-s3-key-secret
- S3 repository secret access key.
- --repo-s3-key-type
- S3 repository key type.
- --repo-s3-kms-key-id
- S3 repository KMS key.
- --repo-s3-region
- S3 repository region.
- --repo-s3-role
- S3 repository role.
- --repo-s3-sse-customer-key
- S3 Repository SSE Customer Key.
- --repo-s3-token
- S3 repository security token.
- --repo-s3-uri-style
- S3 URI Style.
- --repo-sftp-host
- SFTP repository host.
- --repo-sftp-host-fingerprint
- SFTP repository host fingerprint.
- --repo-sftp-host-key-check-type
- SFTP host key check type.
- --repo-sftp-host-key-hash-type
- SFTP repository host key hash type.
- --repo-sftp-host-port
- SFTP repository host port.
- --repo-sftp-host-user
- SFTP repository host user.
- --repo-sftp-known-host
- SFTP known hosts file.
- --repo-sftp-private-key-file
- SFTP private key file.
- --repo-sftp-private-key-passphrase
- SFTP private key passphrase.
- --repo-sftp-public-key-file
- SFTP public key file.
- --repo-storage-ca-file
- Repository storage CA file.
- --repo-storage-ca-path
- Repository storage CA path.
- --repo-storage-host
- Repository storage host.
- --repo-storage-port
- Repository storage port.
- --repo-storage-tag
- Repository storage tag(s).
- --repo-storage-upload-chunk-size
- Repository storage upload chunk size.
- --repo-storage-verify-tls
- Repository storage certificate verify.
- --repo-type
- Type of storage used for the repository.
Restore Options:
- --archive-mode
- Preserve or disable archiving on restored cluster.
- --db-exclude
- Restore excluding the specified databases.
- --db-include
- Restore only specified databases.
- --force
- Force a restore.
- --link-all
- Restore all symlinks.
- --link-map
- Modify the destination of a symlink.
- --recovery-option
- Set an option in postgresql.auto.conf or recovery.conf.
- --set
- Backup set to restore.
- --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.
- --target-exclusive
- Stop just before the recovery target is reached.
- --target-timeline
- Recover along a timeline.
- --type
- Recovery type.
Server Options:
- --tls-server-address
- TLS server address.
- --tls-server-auth
- TLS server authorized clients.
- --tls-server-ca-file
- TLS server certificate authorities.
- --tls-server-cert-file
- TLS server certificate file.
- --tls-server-key-file
- TLS server key file.
- --tls-server-port
- TLS server port.
Stanza Options:
- --pg-database
- PostgreSQL database.
- --pg-host
- PostgreSQL host for operating remotely.
- --pg-host-ca-file
- PostgreSQL host certificate authority file.
- --pg-host-ca-path
- PostgreSQL host certificate authority path.
- --pg-host-cert-file
- PostgreSQL host certificate file.
- --pg-host-cmd
- PostgreSQL host pgBackRest command.
- --pg-host-config
- pgBackRest database host configuration file.
- --pg-host-config-include-path
- pgBackRest database host configuration include path.
- --pg-host-config-path
- pgBackRest database host configuration path.
- --pg-host-key-file
- PostgreSQL host key file.
- --pg-host-port
- PostgreSQL host port when pg-host is set.
- --pg-host-type
- PostgreSQL host protocol type.
- --pg-host-user
- PostgreSQL host logon user when pg-host is set.
- --pg-path
- PostgreSQL data directory.
- --pg-port
- PostgreSQL port.
- --pg-socket-path
- PostgreSQL unix socket path.
- --pg-user
- PostgreSQL database user.
Stanza-create Options:
- --online
- Create on an online cluster.
Stanza-delete Options:
- --force
- Force stanza delete.
Stanza-upgrade Options:
- --online
- Update an online cluster.
Stop Options:
- --force
- Force all pgBackRest processes to stop.
Verify Options:
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
19 August 2024 |