Scheduling¶
Since BART, Barman, and pgBackRest all schedule the backups using cron, changing the scheduling simply requires changing the scheduled commands. Example commands for BART, Barman, and pgBackRest
Run a full backup for cluster ‘example’
Tool
Command
BART
bart BACKUP –s exampleBarman
barman backup examplepgBackRest
pgbackrest backup --type=full --stanza=exampleRun a full backup for all configured servers
Tool
Command
BART
bart BACKUP –s allBarman
barman backup allp gBackRest
pgbackrest does not have an option to run for all stanzas with one command
Run an incremental backup
Tool
Command
BART
Retrieve the
backup_id/backup_namefor the parent (select a full for an incremental, select another inc/diff for a differential backup plan):bart SHOW-BACKUPS exampleNow supply thebackup_id/backup_nameas parent:bart BAC KUP –s example --parent { backup_id \| backup_name }Barman
barman backup example --reuse-backup=linkThis can also be set in the configuration file at the global/server level withreuse_backup = linkp gBackRest
Incremental:
pgback rest backup --type=incr --stanza=exampleDifferentialpgbackrest backup --type=diff --stanza=example
Retention management¶
With BART usually a cron job is set up to run maintenance on the BART repository (bart MANAGE). By supplying the -d option, the obsoleted backups are automatically cleaned (together with their WAL archives).
Similarly, Barman uses a cron command to run maintenance on the Barman repository `barman cron`. The `barman cron` command takes care of more things (like copying streamed WAL files to the WAL archive directory), and needs to be scheduled to run every minute. The Barman rpm or debian package automatically creates a cron entry running every minute as the barman user.
pgBackRest runs maintenance with the expire command (pgbackrest expire), but the expire command is run automatically after each successful backup, and is not required to be separately scheduled.
While migrating to a new tool, make sure that cron is reconfigured to run the proper retention management commands.