Install pgBackRest on the database server and a repository host (or use an S3-compatible object store); create /etc/pgbackrest/pgbackrest.conf with [global] and [stanza-name] sections defining repo1-path and pg1-path
In postgresql.conf set archive_mode=on and archive_command='pgbackrest --stanza=main archive-push %p'; also set wal_level=replica
Initialize the stanza: pgbackrest --stanza=main stanza-create, then run a full backup: pgbackrest --stanza=main --type=full backup
Schedule incremental backups with cron; pgBackRest automatically expires old backups per repo1-retention-full and retains WAL to support PITR across retained backups
To restore to a point in time: stop PostgreSQL, run pgbackrest --stanza=main --type=time '--target=2025-06-10 14:30:00' --target-action=promote restore, then start PostgreSQL
Verify backup integrity periodically with pgbackrest --stanza=main check and pgbackrest info
Known gotchas
repo1-retention-archive-type and repo1-retention-archive control how much WAL is kept; setting repo1-retention-archive lower than the number of full backups retained will silently drop WAL needed for PITR from older backups
The archive_command runs as the PostgreSQL OS user; ensure pgBackRest's repository is readable/writable by that user and that SSH keys or object-store credentials are configured before enabling archiving
pgBackRest's restore overwrites the data directory; always test your recovery procedure in a staging environment and keep the original data directory backed up until the restore is validated
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp