This repository contains an Ansible playbook for setting up a sync of read-only BorgBase backups to a local disk. The playbook will create a script that can be run to sync the latest backup from each repository to the local disk.
- Copy the
group_vars/all.yml.tpltogroup_vars/all.yml:
cp group_vars/all.yml.tpl group_vars/all.yml-
Insert your variables into
group_vars/all.yml, such as your SSH key file path and BorgBase repository details. -
Run the playbook:
ansible-playbook main.yml-
Prepare the disk: Simply set it up to auto mount to your desired location.
-
Run the script:
sudo /home/user/.local/bin/my-borgbase-sync.sh(Optional but dangerous): Use the flag --bypass-lock to bypass the lock file. This is very dangerous and only used if 100% sure that no other borg operation can write to the archive, so no compacting and only append-only mode activated. Might be useful to backup all your repositories in one go while still allowing other append-only operations to run in parallel since none can change the archives in this mode.
The playbook will:
- Install a script (
my-borgbase-sync.sh) in your~/.local/bindirectory for performing the sync operations.