remove stale locks
This commit is contained in:
parent
3878013afc
commit
c432bffe76
1 changed files with 15 additions and 5 deletions
|
|
@ -90,13 +90,23 @@ function check_restic() {
|
||||||
# begin timestamp
|
# begin timestamp
|
||||||
echo "== ${TIMESTAMP} ==" >> "${LOGFILE}"
|
echo "== ${TIMESTAMP} ==" >> "${LOGFILE}"
|
||||||
|
|
||||||
|
# remove stale locks
|
||||||
|
restic -r "${REPO}" \
|
||||||
|
--password-file="${RKEY}" \
|
||||||
|
unlock >> "${LOGFILE}"
|
||||||
|
_EC=$?
|
||||||
|
|
||||||
# create a new snapshot
|
# create a new snapshot
|
||||||
restic --quiet -r "${REPO}" \
|
if [[ $_EC -eq 0 ]]; then
|
||||||
|
restic --quiet -r "${REPO}" \
|
||||||
backup --no-scan \
|
backup --no-scan \
|
||||||
--password-file="${RKEY}" \
|
--password-file="${RKEY}" \
|
||||||
--exclude-file="${EXCL}" \
|
--exclude-file="${EXCL}" \
|
||||||
"${RSRC}" >> "${LOGFILE}"
|
"${RSRC}" >> "${LOGFILE}"
|
||||||
_EC=$?
|
_EC=$?
|
||||||
|
else
|
||||||
|
echo "Non-zero exit from restic unlock: $_EC" >> "${LOGFILE}"
|
||||||
|
fi
|
||||||
|
|
||||||
# prune older snapshots
|
# prune older snapshots
|
||||||
if [[ $_EC -eq 0 ]]; then
|
if [[ $_EC -eq 0 ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue