← 返回命令列表

Linux command

pg_verifybackup 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Verify a backup

pg_verifybackup [backup_dir]

Verify with progress reporting

pg_verifybackup -P [backup_dir]

Skip WAL verification

pg_verifybackup -n [backup_dir]

Skip data file checksum verification (faster)

pg_verifybackup -s [backup_dir]

Use a manifest file from a different location

pg_verifybackup -m [/path/to/backup_manifest] [backup_dir]

Verify with WAL files from a separate directory

pg_verifybackup -w [/path/to/wal_dir] [backup_dir]

说明

pg_verifybackup verifies the integrity of a backup taken with pg_basebackup. It checks the backup manifest for completeness and verifies file checksums. Running this after a backup helps ensure recoverability. By default, it also parses any WAL files required to restore from the backup to verify they are present and uncorrupted.

参数

-e, --exit-on-error
Exit as soon as a problem is detected, instead of continuing to report all errors.
--ignore=_path_
Ignore the specified file or directory (relative path) when comparing against the manifest.
-m _path_, --manifest-path=_path_
Use the manifest file at the specified path instead of one in the backup root.
-n, --no-parse-wal
Skip parsing write-ahead log data needed for recovery.
-P, --progress
Show progress while verifying checksums. Cannot be used with `--quiet`.
-q, --quiet
Do not print anything when a backup is successfully verified.
-s, --skip-checksums
Skip data file checksum verification. File presence and sizes are still checked.
-w _dir_, --wal-directory=_dir_
Parse WAL files from the specified directory instead of `pg_wal` in the backup.

FAQ

What is the pg_verifybackup command used for?

pg_verifybackup verifies the integrity of a backup taken with pg_basebackup. It checks the backup manifest for completeness and verifies file checksums. Running this after a backup helps ensure recoverability. By default, it also parses any WAL files required to restore from the backup to verify they are present and uncorrupted.

How do I run a basic pg_verifybackup example?

Run `pg_verifybackup [backup_dir]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -e, --exit-on-error do in pg_verifybackup?

Exit as soon as a problem is detected, instead of continuing to report all errors.