You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/pig/cmd/pb.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,43 @@ weight: 670
7
7
8
8
The `pig pgbackrest` command (alias `pig pb`) manages pgBackRest backup and point-in-time recovery (PITR). It wraps common `pgbackrest` operations for simplified backup management. All commands execute as database superuser (default `postgres`).
9
9
10
+
```bash
11
+
pig pb - Manage pgBackRest backup and point-in-time recovery.
12
+
13
+
Information:
14
+
pig pb info show backup info
15
+
pig pb ls list backups
16
+
pig pb ls repo list configured repositories
17
+
pig pb ls stanza list all stanzas
18
+
19
+
Backup & Restore:
20
+
pig pb backup create backup (auto: full/incr)
21
+
pig pb backup full create full backup
22
+
pig pb restore restore from backup (PITR)
23
+
pig pb restore -t "..." restore to specific time
24
+
pig pb expire cleanup expired backups
25
+
26
+
Stanza Management:
27
+
pig pb create create stanza (first-time setup)
28
+
pig pb upgrade upgrade stanza (after PG upgrade)
29
+
pig pb delete delete stanza (DANGEROUS!)
30
+
31
+
Control:
32
+
pig pb check verify backup integrity
33
+
pig pb start enable pgBackRest operations
34
+
pig pb stop disable pgBackRest operations
35
+
pig pb log view pgBackRest logs
36
+
37
+
Examples:
38
+
pig pb info # show all backup info
39
+
pig pb backup # auto: full if none, else incr
40
+
pig pb backup full # full backup
41
+
pig pb restore # restore to latest (default)
42
+
pig pb restore -t "2025-01-01 12:00:00+08"# restore to time
Copy file name to clipboardExpand all lines: content/pig/cmd/pg.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,45 @@ weight: 650
7
7
8
8
The `pig pg` command (alias `pig postgres`) manages local PostgreSQL server and databases. It wraps native tools like `pg_ctl`, `psql`, `vacuumdb`, providing a simplified server management experience.
9
9
10
+
```bash
11
+
pig pg - Manage local postgres server (pg_ctl, psql, vacuumdb)
Copy file name to clipboardExpand all lines: content/pig/cmd/pitr.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,39 @@ weight: 680
7
7
8
8
The `pig pitr` command performs **Orchestrated Point-In-Time Recovery**. Unlike `pig pb restore`, this command automatically coordinates Patroni, PostgreSQL, and pgBackRest to complete the full PITR workflow.
9
9
10
+
```bash
11
+
pig pitr - Perform PITR with automatic Patroni/PostgreSQL lifecycle management.
12
+
13
+
This command orchestrates a complete PITR workflow:
14
+
1. Stop Patroni service (if running)
15
+
2. Ensure PostgreSQL is stopped (with retry and fallback)
16
+
3. Execute pgbackrest restore
17
+
4. Start PostgreSQL
18
+
5. Provide post-restore guidance
19
+
20
+
Recovery Targets (at least one required):
21
+
--default, -d Recover to end of WAL stream (latest)
22
+
--immediate, -I Recover to backup consistency point
23
+
--time, -t Recover to specific timestamp
24
+
--name, -n Recover to named restore point
25
+
--lsn, -l Recover to specific LSN
26
+
--xid, -x Recover to specific transaction ID
27
+
28
+
Time Format:
29
+
- Full: "2025-01-01 12:00:00+08"
30
+
- Date only: "2025-01-01" (defaults to 00:00:00)
31
+
- Time only: "12:00:00" (defaults to today)
32
+
33
+
Examples:
34
+
pig pitr -d # Recover to latest (most common)
35
+
pig pitr -t "2025-01-01 12:00"# Recover to specific time
36
+
pig pitr -I # Recover to backup consistency point
37
+
pig pitr -d --dry-run # Show execution plan without running
Copy file name to clipboardExpand all lines: content/pig/cmd/pt.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,33 @@ weight: 660
7
7
8
8
The `pig patroni` command (alias `pig pt`) manages Patroni service and PostgreSQL HA clusters. It wraps common `patronictl` and `systemctl` operations for simplified cluster management.
9
9
10
+
```bash
11
+
pig pt - Manage Patroni cluster using patronictl commands.
Copy file name to clipboardExpand all lines: content/pig/cmd/repo.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,37 @@ weight: 610
7
7
8
8
The `pig repo` command is a comprehensive tool for managing package repositories on Linux systems. It provides functionality to add, remove, create, and manage software repositories for both RPM-based (RHEL/CentOS/Rocky/Alma) and Debian-based (Debian/Ubuntu) distributions. This command is essential for setting up the required repositories to install PostgreSQL and its extensions.
0 commit comments