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 <noreply@anthropic.com>
This commit is contained in:
Julien Lutran
2026-08-28 18:10:38 +02:00
co-authored by Claude Fable 5
parent 1ab7337d22
commit bab0ae5386
+4
View File
@@ -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 \