Every time you execute the barman backup command for a given server, you take a full base backup (a more generic term for this is periodical full backup). Once completed, this backup can be used as a base for any recovery operation from the start time of the backup to the last available WAL file for that server (provided there is continuity among all the WAL segments).
As mentioned earlier, by scheduling daily or weekly automated backups, you end up having several periodic backups for a server. In Barman's jargon, this is known as the backup catalog and it is one of our favorite features of this tool.
At any time, you can get a list of available backups for a given server through the list-backup command:
[root@malcolm ~]# barman list-backup angus
7angus 20171003T194717 - Mon Oct 3 19:47:20 2017 - Size: 21.1 MiB - WAL Size: 26.6 KiB
The last informative command you might want to get familiar with is show-backup, which gives you detailed information on a specific backup regarding the server, base backup time, WAL archive, and context within the catalog (for example, the last available backup):
[root@malcolm ~]# barman show-backup angus 20171003T194717
Rather than the full backup ID (20171003T194717), you can use a few synonyms, such as these:
- Last or latest: This refers to the latest available backup (the last in the catalog)
- First or oldest: This refers to the oldest available backup (the first in the catalog)
For the show-backup command, however, we will use a real and concrete example, taken directly from one of our customer's installations of Barman on a 16.4 TB Postgres 9.4 database:
Backup 20170930T130002:
Server Name : skynyrd
Status : DONE
PostgreSQL Version : 90409
PGDATA directory : /srv/pgdata
Base backup information:
Disk usage : 16.4 TiB (16.4 TiB with WALs)
Incremental size : 5.7 TiB (-65.08%)
Timeline : 1
Begin WAL : 000000010000358800000063
End WAL : 00000001000035A0000000A2
WAL number : 6208
WAL compression ratio: 79.15%
Begin time : 2017-09-30 13:00:04.245110+00:00
End time : 2017-10-01 13:24:47.322288+00:00
Begin Offset : 24272
End Offset : 11100576
Begin XLOG : 3588/63005ED0
End XLOG : 35A0/A2A961A0
WAL information:
No of files : 3240
Disk usage : 11.9 GiB
WAL rate : 104.33/hour
Compression ratio : 76.43%
Last available : 00000001000035AD0000004A
Catalog information:
Retention Policy : not enforced
Previous Backup : 20170923T130001
Next Backup : - (this is the latest base backup)
As you can see, Barman is a production-ready tool that can be used in large, business-critical contexts, as well as in basic Postgres installations. It provides good Recovery Point Objective (RPO) outcomes, allowing you to limit potential data loss to a single WAL file.
Finally, Barman also supports WAL streaming, which dramatically reduces the amount of data you can lose. With synchronous replication and replication slot support, you can achieve zero data loss backups. For further information, please refer to Barman's documentation, in particular: streaming_archiver, streaming_archiver_name, streaming_conninfo, and slot_name.
Barman is distributed under GNU GPL 3 terms and is available for download at http://www.pgbarman.org/.
There is also a module for Puppet available at https://github.com/2ndquadrant-it/puppet-barman.
For further and more detailed information, refer to the following:
- The man barman command, which gives the man page for the Barman application
- The man 5 barman command, which gives the man page for the configuration file
- The barman help command, which gives a list of the available commands
- The official documentation for Barman, publicly available at http://docs.pgbarman.org/
- The mailing list for community support at http://www.pgbarman.org/support/