Barman is a Python application that wraps PostgreSQL core technology for continuous backup and PITR. It also adds some practical functionality focused on helping the database administrator manage disaster recovery of one or more PostgreSQL servers.
When devising Barman, we decided to keep the design simple and not to use any daemon or client/server architecture. Maintenance operations are simply delegated to the barman cron command, which is mainly responsible for archiving WAL files (moving them from the incoming directory to the WAL file and compressing them) and managing retention policies.
If you have installed Barman through RPM or APT packages, you will notice that maintenance is run every minute through cron:
[root@malcolm ~]# cat /etc/cron.d/barman
# m h dom mon dow user command
* * * * * barman [ -x /usr/bin/barman ] && /usr/bin/barman -q cron
Barman follows the convention over configuration paradigm and uses an INI format configuration file with options operating at two different levels:
- Global options: These are options specified in the [barman] section, used by any Barman command and for every server. Several global options can be overridden at the server level.
- Server options: These are options specified in the [SERVER_ID] section, used by server commands. These options can be customized at the server level (including overriding general settings).
The SERVER_ID placeholder (such as angus) is fundamental, as it identifies the server in the catalog (therefore, it must be unique).
Similarly, commands in Barman are of two types:
- Global commands: These are general commands, not tied with any server in particular, such as a list of the servers managed by the Barman installation (list-server) and maintenance (cron)
- Server commands: These are commands executed on a specific server, such as diagnostics (check and status), backup control (backup, list-backup, delete and show-backup), and recovery control (recover, which is discussed in the next recipe, Recovery with Barman)
The previous sections of this recipe showed you how to add a server (angus) to a Barman installation on the malcolm server. You can easily add a second server (bon) to the Barman server on malcolm. All you have to do is create the bon.conf file in the /etc/barman.d directory and repeat the steps outlined in the How it works... section, as you have done for angus.