Backing up a database with Barman
After Barman is installed, we should be able to leverage any of its capabilities using the Barman command-line tool. For now, we will focus entirely on creating a backup, verifying that the new backup exists, and examining its contents.
Barman doesn't just produce backups, it also catalogs them extensively. We will use this to our advantage in this recipe to prove that Barman works as advertised.
Getting ready
This recipe depends on Barman being installed on a backup server. Please follow the Installing and configuring Barman recipe before continuing.
How to do it...
All steps should be executed as the barman
system user on the pg-backup
server that we were using in the previous recipe. Follow these steps to create, verify, and examine a Barman backup:
- Create the first backup with this command:
barman backup primary
- Examine a list of backups with this command:
barman list-backup primary
- View the metadata of the most recent backup with this command:
barman show-backup...