From 91725d58768665dcc5a209f32e09653a3041e1d6 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 16 May 2021 14:39:44 +0100 Subject: [PATCH] Add forget and prune commands --- ansible/roles/restic/files/backrest.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ansible/roles/restic/files/backrest.sh b/ansible/roles/restic/files/backrest.sh index 176579b..9171bdb 100644 --- a/ansible/roles/restic/files/backrest.sh +++ b/ansible/roles/restic/files/backrest.sh @@ -27,6 +27,18 @@ backup() { restic --verbose backup {{ restic_backup_locations|join(' ') }} } +# Forget legacy snapshots +forget() { + set -x + restic forget --keep-daily 7 --keep-weekly 2 $@ +} + +# Prune orphaned files +prune() { + set -x + restic --verbose prune $@ +} + # Run restic, but with environment variables set exec () { set -x