Perform a forget and prune in one step
This commit is contained in:
parent
0037a68143
commit
5e91ca7d44
16
restic-cron
16
restic-cron
|
@ -46,26 +46,16 @@ if [ $status -ne 0 ]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Forget old snapshots
|
# Forget old snapshots and prune the repository
|
||||||
test -z "$RESTIC_QUIET" && echo "I: Forget step…"
|
test -z "$RESTIC_QUIET" && echo "I: Forget step…"
|
||||||
restic $RESTIC_QUIET forget $RESTIC_FORGET_OPTIONS
|
restic $RESTIC_QUIET forget --prune $RESTIC_FORGET_OPTIONS
|
||||||
status=$?
|
status=$?
|
||||||
if [ $status -ne 0 ]; then
|
if [ $status -ne 0 ]; then
|
||||||
echo "E: Exit code was $status"
|
echo "E: Exit code was $status"
|
||||||
notify "Was not able to forget old snapshots!"
|
notify "Was not able to forget old snapshots and/or prune the repository!"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prune the repository
|
|
||||||
test -z "$RESTIC_QUIET" && echo "I: Prune step…"
|
|
||||||
restic $RESTIC_QUIET prune
|
|
||||||
status=$?
|
|
||||||
if [ $status -ne 0 ]; then
|
|
||||||
echo "E: Exit code was $status"
|
|
||||||
notify "Was not able to prune the repository!"
|
|
||||||
exit 4
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Verify the backup
|
# Verify the backup
|
||||||
test -z "$RESTIC_QUIET" && echo "I: Check step…"
|
test -z "$RESTIC_QUIET" && echo "I: Check step…"
|
||||||
restic $RESTIC_QUIET check
|
restic $RESTIC_QUIET check
|
||||||
|
|
Loading…
Reference in New Issue