fix(restic): if repository exists but is locked, ensure it is unlocked

This commit is contained in:
transcaffeine 2025-04-05 15:39:17 +02:00
parent ed95d4fd3d
commit 4bddc95161
Signed by: transcaffeine
GPG Key ID: 03624C433676E465

View File

@ -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