
Borg 1.2 exits 0 for success, exists 1 for backup completion with warnings and exits >1 for proper errors. The most common cause of a warning appear to be a file changing while it is backed up. This causes paste02 backups to consistently email us because our borg backup script exits 1 which we treat as a failure. Update the script so that when borg 1.2.8 is in use we treat rc 1 as a success with warnings rather than failure with warnings. This should make our cron job quieter and match the old 1.1.18 behavior. To better test this we also drop the backup exclusion for the borg backup log file (which we write to as we backup so it is very likely to change during backups). Change-Id: Iab69f0d5951247897d204dcb0a2face424472db0
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)