This repository has been archived on 2023-12-26. You can view files and clone it, but cannot push or open issues or pull requests.
hypervisors/ansible/roles/borg/backup.yml.j2

21 lines
780 B
Text
Raw Normal View History

2023-06-17 10:54:41 +00:00
location:
source_directories:
- /mnt/thecloud
repositories:
- /mnt/backups/share
retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
hooks:
before_everything:
- virsh snapshot-create-as --domain tf-thecloud --name backup-thecloud --disk-only --quiesce --no-metadata --diskspec vda,snapshot=no --diskspec vdb,file=/kvm/snapshots/thecloud.qcow2
- guestmount -a /kvm/snapshots/thecloud.qcow2 -m /dev/sda1 --ro /mnt/thecloud
after_everything:
- guestunmount /mnt/thecloud && sleep 1
- virsh blockcommit tf-thecloud vdb --active --verbose --pivot
- rm /kvm/snapshots/thecloud.qcow2
2023-06-17 11:14:30 +00:00
- apprise --body="Backup succeeded" {{ apprise_url }} || true
on_error:
- apprise --body="Error while performing backup" {{ apprise_url }} || true