remove stale locks

This commit is contained in:
tengel 2024-12-25 07:29:27 -06:00
parent 3878013afc
commit c432bffe76

View file

@ -90,14 +90,24 @@ function check_restic() {
# begin timestamp
echo "== ${TIMESTAMP} ==" >> "${LOGFILE}"
# create a new snapshot
restic --quiet -r "${REPO}" \
backup --no-scan \
# remove stale locks
restic -r "${REPO}" \
--password-file="${RKEY}" \
--exclude-file="${EXCL}" \
"${RSRC}" >> "${LOGFILE}"
unlock >> "${LOGFILE}"
_EC=$?
# create a new snapshot
if [[ $_EC -eq 0 ]]; then
restic --quiet -r "${REPO}" \
backup --no-scan \
--password-file="${RKEY}" \
--exclude-file="${EXCL}" \
"${RSRC}" >> "${LOGFILE}"
_EC=$?
else
echo "Non-zero exit from restic unlock: $_EC" >> "${LOGFILE}"
fi
# prune older snapshots
if [[ $_EC -eq 0 ]]; then
restic --quiet -r "${REPO}" \