system-config/playbooks/roles/borg-backup
Clark Boylan dda97505d8 Add hints to borg backup error logging
I spent a number of hours recently trying to debug why mysqldump stopped
working. In reality it appears that the problem was borg-backup's ssh
connectivity causing the mysql-dump to not be able to stream properly.
Add a logging note about checking the other half of backup streaming
when the streaming script fails to try and make it more obvious this may
ocurr.

Change-Id: Idf53fc9e61f05077b954d730d88beab0cc1db09b
2023-12-11 08:42:04 -08:00
..
defaults Borg ignore ansible tmp files 2022-05-05 08:36:20 -07:00
tasks Force borg backups to run over ipv4 2023-12-11 08:32:14 -08:00
templates Add hints to borg backup error logging 2023-12-11 08:42:04 -08:00
README.rst borg-backup: implement saving a stream, use for database backups 2021-02-03 11:43:12 +11:00

Configure a host to be backed up

This role setups a host to use borgp for backup to any hosts in the borg-backup-server group.

A separate ssh key will be generated for root to connect to the backup server(s) and the host key for the backup servers will be accepted to the host.

The borg tool is installed and a cron job is setup to run the backup periodically.

Note the borg-backup-server role must run after this to create the user correctly on the backup server. This role sets a tuple borg_user with the username and public key; the borg-backup-server role uses this variable for each host in the borg-backup group to initalise users.

Hosts can place into /etc/borg-streams which should be a script that outputs to stdout data to be fed into a backup archive on each run. This will be saved to an archive with the name of the file. This is useful for raw database dumps which allow borg to deduplicate as much as possible.

Role Variables

The username to connect to the backup server. If this is left undefined, it will be automatically set to borg-$(hostname)