remove stale locks
This commit is contained in:
parent
3878013afc
commit
c432bffe76
1 changed files with 15 additions and 5 deletions
|
|
@ -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}" \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue