Commit 35927e41 authored by Evangelos Foutras's avatar Evangelos Foutras 🐱
Browse files

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

borg_client: run compact after pruning on borg 1.2

See merge request !577
parents f6e66116 17927c9a
Pipeline #18917 passed with stage
in 35 seconds
...@@ -4,7 +4,9 @@ backup_hosts: ...@@ -4,7 +4,9 @@ backup_hosts:
dir: "~/repo" dir: "~/repo"
suffix: "" suffix: ""
borg_cmd: "borg" borg_cmd: "borg"
compact_after_prune: true
- host: "ssh://zh1905@zh1905.rsync.net:22" - host: "ssh://zh1905@zh1905.rsync.net:22"
dir: "~/backup/{{ inventory_hostname }}" dir: "~/backup/{{ inventory_hostname }}"
suffix: "-offsite" suffix: "-offsite"
borg_cmd: "borg --remote-path=borg1" borg_cmd: "borg --remote-path=borg1"
compact_after_prune: false # not upgraded to borg 1.2 yet
...@@ -88,4 +88,9 @@ fi ...@@ -88,4 +88,9 @@ fi
-e "$backup_mountdir/var/lib/archbuilddest" \ -e "$backup_mountdir/var/lib/archbuilddest" \
-e "$backup_mountdir/var/lib/docker" \ -e "$backup_mountdir/var/lib/docker" \
{{ item['host'] }}/{{ item['dir'] }}::$(date "+%Y%m%d-%H%M%S") "$backup_mountdir" {{ 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 {{ 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 %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment