User Tools

Site Tools


barman

This is an old revision of the document!


Barman

Barman encryption

Generate pgp keys for the encryption

# create 32 char password for pgp
date +%s | sha256sum | base64 | head -c 32 ;echo

#
# 1 save the output in /etc/barman.d/secret 
# 2 make sure that permissions for the secret is root.barman-owner and 440
# 3 and use it for input in the next step and i in the barman server.conf
#
# create pgp entry

gpg --full-generate-key

# When asked: give a name like: barman and the password from previous command

In the /etc/barman.d/server.conf insert

backup_compression_format = tar
backup_compression = gzip
encryption = gpg 
encryption_key_id = barman
encryption_passphrase_command = "cat /etc/barman.d/secret"

Done

You will have to re-initiate the backup, ie (be careful and not just c&p, but think):

sudo barman cron
sudo -u barman  barman receive-wal --create-slot SERVER-NAME
sudo -u barman  barman switch-xlog SERVER-NAME
sudo -u barman  barman backup SERVER-NAME

If create-slot fails, you will have to –drop-slot or drop the slot from the database.

You can see that the encryption is in plays:

sudo -u barman  barman check SERVER-NAME | grep encryption
 
barman.1761567406.txt.gz · Last modified: 2025/10/27 13:16 by jbi