1
1
Fork 0
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2024-05-06 09:56:02 +02:00

Merge branch 'borg-compact-after-prune' into 'master'

borg_client: run compact after pruning on borg 1.2

See merge request archlinux/infrastructure!577
This commit is contained in:
Evangelos Foutras 2022-05-17 15:26:10 +00:00
commit 35927e41d2
2 changed files with 7 additions and 0 deletions

View File

@ -4,7 +4,9 @@ backup_hosts:
dir: "~/repo"
suffix: ""
borg_cmd: "borg"
compact_after_prune: true
- host: "ssh://zh1905@zh1905.rsync.net:22"
dir: "~/backup/{{ inventory_hostname }}"
suffix: "-offsite"
borg_cmd: "borg --remote-path=borg1"
compact_after_prune: false # not upgraded to borg 1.2 yet

View File

@ -88,4 +88,9 @@ fi
-e "$backup_mountdir/var/lib/archbuilddest" \
-e "$backup_mountdir/var/lib/docker" \
{{ item['host'] }}/{{ item['dir'] }}::$(date "+%Y%m%d-%H%M%S") "$backup_mountdir"
{{ item['borg_cmd'] }} prune -v {{ item['host'] }}/{{ item['dir'] }} --keep-daily=7 --keep-weekly=4 --keep-monthly=6
{% if item['compact_after_prune'] %}
{{ item['borg_cmd'] }} compact -v {{ item['host'] }}/{{ item['dir'] }}
{% endif %}