From 4bddc95161306c0053f554d044a8293ded3d1d7c Mon Sep 17 00:00:00 2001 From: transcaffeine Date: Sat, 5 Apr 2025 15:39:17 +0200 Subject: [PATCH] fix(restic): if repository exists but is locked, ensure it is unlocked --- roles/restic/files/restic-backup-directories.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/restic/files/restic-backup-directories.sh b/roles/restic/files/restic-backup-directories.sh index a39ff3b..4df56fa 100644 --- a/roles/restic/files/restic-backup-directories.sh +++ b/roles/restic/files/restic-backup-directories.sh @@ -6,9 +6,9 @@ if [[ -n ${RESTIC_PRE_BACKUP_HOOK-} ]]; then /bin/bash -c "$RESTIC_PRE_BACKUP_HOOK" fi -echo "List existing snapshots or initialize repository" -restic snapshots || restic init -sleep 2; +echo "List existing snapshots or attempt to initialize/unlock repository" +restic snapshots || restic init || restic unlock +sleep 1; echo "Attempting to remove lock if present" restic unlock