From bab0ae5386dd04a54be19160cc53bc0e08a6e5c9 Mon Sep 17 00:00:00 2001 From: Julien Lutran Date: Fri, 28 Aug 2026 18:10:38 +0200 Subject: [PATCH] restic-backup: unlock stale locks before backing up A backup killed mid-run leaves a lock behind; the next night's backup still works (non-exclusive) but forget fails and the run reports rc=1 for ever. restic-maintenance.sh already did this. Co-Authored-By: Claude Fable 5 --- restic-backup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/restic-backup.sh b/restic-backup.sh index 0741497..1549d25 100755 --- a/restic-backup.sh +++ b/restic-backup.sh @@ -149,6 +149,10 @@ fi # stage dumps if [ "$STAGE" = all ] || [ "$STAGE" = backup ]; then +# clear locks left by a killed run (safe: only stale ones are removed); +# otherwise a single interrupted backup blocks forget/prune for ever +$RESTIC -r "$REPO" unlock >/dev/null 2>&1 || true + log "restic backup -> $REPO" $RESTIC -r "$REPO" backup \ --pack-size 64 --read-concurrency 8 -o s3.connections=8 \