Skip to content

Commit 4f0a4f9

Browse files
harryfrzzdmmqzManagor
authored andcommitted
pg_basebackup: add page (tldr-pages#18698)
Co-authored-by: Dylan <[email protected]> Co-authored-by: Managor <[email protected]>
1 parent 7b14de3 commit 4f0a4f9

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

pages/common/pg_basebackup.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# pg_basebackup
2+
3+
> Take a base backup of a running PostgreSQL cluster.
4+
> Used for full or incremental backups, point-in-time recovery, or setting up replication standbys.
5+
> More information: <https://www.postgresql.org/docs/current/app-pgbasebackup.html>.
6+
7+
- Take a base backup from a remote PostgreSQL server:
8+
9+
`pg_basebackup {{[-h|--host]}} {{host}} {{[-D|--pgdata]}} {{path/to/backup_dir}}`
10+
11+
- Take a backup with progress shown:
12+
13+
`pg_basebackup {{[-h|--host]}} {{host}} {{[-D|--pgdata]}} {{path/to/backup_dir}} {{[-P|--progress]}}`
14+
15+
- Create a compressed backup (`gzip`) in tar format:
16+
17+
`pg_basebackup {{[-D|--pgdata]}} {{path/to/backup_dir}} {{[-F|--format]}} {{[t|tar]}} {{[-z|--gzip]}}`
18+
19+
- Create an incremental backup using a previous manifest file:
20+
21+
`pg_basebackup {{[-D|--pgdata]}} {{path/to/backup_dir}} {{[-i|--incremental]}} {{path/to/old_manifest}}`
22+
23+
- Write a recovery configuration for setting up a standby:
24+
25+
`pg_basebackup {{[-D|--pgdata]}} {{path/to/backup_dir}} {{[-R|--write-recovery-conf]}}`
26+
27+
- Relocate a tablespace during backup:
28+
29+
`pg_basebackup {{[-D|--pgdata]}} {{path/to/backup_dir}} {{[-T|--tablespace-mapping]}} {{path/to/old_tablespace}}={{path/to/new_tablespace}}`
30+
31+
- Limit transfer rate to reduce server load:
32+
33+
`pg_basebackup {{[-D|--pgdata]}} {{path/to/backup_dir}} {{[-r|--max-rate]}} {{100M}}`
34+
35+
- Stream WAL logs while taking the backup:
36+
37+
`pg_basebackup {{[-D|--pgdata]}} {{path/to/backup_dir}} {{[-X|--wal-method]}} stream`

0 commit comments

Comments
 (0)