system-config/playbooks/roles/borg-backup
Ian Wienand 5ca69113fd borg-backup: send explicit email on backup failure
This sets a global BORG_UNDER_CRON=1 environment variable for
production hosts and makes the borg-backup script send an email if any
part of the backup job appears to fail (this avoids spamming ourselves
if we're testing backups, etc).

We should ideally never get this email, but if we do it's something we
want to investigate quickly.  There's nothing worse than thinking
backups are working when they aren't.

Change-Id: Ibb63f19817782c25a5929781b0f6342fe4c82cf0
2021-02-16 14:49:38 +11:00
..
defaults borg-backup: add a few more global excludes 2021-02-05 11:47:47 +11:00
tasks borg-backup: send explicit email on backup failure 2021-02-16 14:49:38 +11:00
templates borg-backup: send explicit email on backup failure 2021-02-16 14:49:38 +11: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)