borg-backup-server: wait for lock in verify

We have seen a case where the weekly verification run conflicted with
an in-progress backup run.  Make the verification step wait for up to
an hour for the lock to allow backups to complete.

Change-Id: Id87dd090c7cd652695ab0c4aa73477cf0d72c28d
This commit is contained in:
Ian Wienand 2021-10-06 10:34:13 +11:00
parent c80c6eeda9
commit fff85f029c

View File

@ -12,7 +12,7 @@ for u in borg-*; do
sudo BORG_RELOCATED_REPO_ACCESS_IS_OK=y BORG_REPO=${BORG_REPO} -u ${u} -s <<'EOF'
echo "$(date) Verifying ${BORG_REPO} ..."
/opt/borg/bin/borg check --verify-data
/opt/borg/bin/borg check --lock-wait=3600 --verify-data
if [[ $? -ne 0 ]]; then
echo "$(date) *** Verification failed"
echo "Inconsistency found in backup ${BORG_REPO} on $(hostname) at $(date)" |