liveBook · Manning

Backup automation

As explained in PostgreSQL Mistakes and How to Avoid Them

An automated backup is a backup created by scheduled or event-driven software without requiring manual execution.

Backup automation replaces unreliable manual routines with a non-interactive system that creates regular PostgreSQL backups on a schedule or in response to backup events. Manual work varies with distraction, absences, forgotten procedures, and inconsistent timing; automation makes the operation repeatable, but it still requires monitoring and verification. section 9.3 section 9.7

A sound automated backup arrangement should:

  • Schedule regular backups with a reliable task scheduler such as cron, or use PostgreSQL-aware software such as Barman or pgBackRest. section 9.3
  • Combine appropriate base backups with continuous WAL archiving when Point-in-Time Recovery is required. section 9.3 section 9.7
  • Maintain a redundant or offsite copy, monitor backup jobs, and perform a full restore test instead of trusting successful automation alone. section 9.3 section 9.7
  • Avoid mixing logical backups such as pg_dump with physical backups and WAL files for PITR. section 9.3

A safer PostgreSQL arrangement

A dedicated Barman server can automatically pull base backups with pg_basebackup and receive WAL through a replication connection for PITR. Barman or pgBackRest can also support multiple locations, retention policies, complex schedules, transfer methods, and parallelization. The arrangement remains incomplete until monitoring detects failures and a full restore confirms recoverability. section 9.3 section 9.7

Figure 9.2 A sample PostgreSQL backup setup with a dedicated Barman server and geographical redundancy showing the possible transfer paths
figure

Use the diagram to trace a dedicated Barman server, geographical redundancy, base-backup transfers, and WAL transfer paths. section 9.3

How PostgreSQL Mistakes and How to Avoid Them covers it

How deep it goes
Explains scheduling, monitoring, redundancy, WAL archiving, tool choices, and restore testing, but does not provide configuration syntax.
Examples
Uses cron, Barman, pgBackRest, pg_basebackup, a dedicated backup server, offsite copies, and full restore tests.
What it assumes
Assumes PostgreSQL backup fundamentals while distinguishing logical backups, physical backups, WAL archiving, and Point-in-Time Recovery.
What you can do after
Operate and verify scheduled PostgreSQL backups with redundancy, WAL archiving, monitoring, and tested restoration.
How it connects
Connects automated backups with Point-in-Time Recovery, continuous WAL archiving, base backups, retention policies, and replication.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of PostgreSQL Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.