Linux command
pg_combinebackup 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Combine incremental backups
pg_combinebackup [full_backup] [incr_backup] -o [output_dir]
Combine multiple incrementals
pg_combinebackup [full] [incr1] [incr2] -o [output]
说明
pg_combinebackup reconstructs a full backup by merging a base (full) backup with one or more incremental backups taken by pg_basebackup --incremental. The backup directories must be listed in chronological order: the full backup first, followed by each incremental in the order they were taken. The output is a synthetic full backup that can be used directly with pg_restore or as a new base for future incremental backups. Introduced in PostgreSQL 17.
参数
- -o, --output _dir_
- Output directory for the combined backup. Must not already exist.
- -n, --dry-run
- Show what would be done without actually writing output.
- -T _olddir=newdir_
- Relocate a tablespace directory during combination.
- --no-sync
- Skip fsync of the output directory (faster but less safe).
- --sync-method _method_
- Method for syncing: fsync (default) or syncfs.
- --manifest-checksums _algorithm_
- Checksum algorithm for the backup manifest: CRC32C (default), SHA224, SHA256, SHA384, SHA512, or NONE.
- --no-manifest
- Do not generate a backup manifest in the output.
- -d, --debug
- Print debug output.
- -V, --version
- Print version and exit.
FAQ
What is the pg_combinebackup command used for?
pg_combinebackup reconstructs a full backup by merging a base (full) backup with one or more incremental backups taken by pg_basebackup --incremental. The backup directories must be listed in chronological order: the full backup first, followed by each incremental in the order they were taken. The output is a synthetic full backup that can be used directly with pg_restore or as a new base for future incremental backups. Introduced in PostgreSQL 17.
How do I run a basic pg_combinebackup example?
Run `pg_combinebackup [full_backup] [incr_backup] -o [output_dir]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o, --output _dir_ do in pg_combinebackup?
Output directory for the combined backup. Must not already exist.