Only verify the backup every 4 weeks
This commit is contained in:
parent
366507ce4b
commit
5993210ddd
20
restic-cron
20
restic-cron
|
@ -53,14 +53,18 @@ if [ $status -ne 0 ]; then
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify the backup
|
# Verify the backup every 4 weeks
|
||||||
test -z "$RESTIC_QUIET" && echo "I: Check step…"
|
if [ $(($(date +%W) % 4)) = 0 ]; then
|
||||||
restic $RESTIC_QUIET check
|
test -z "$RESTIC_QUIET" && echo "I: Check step…"
|
||||||
status=$?
|
restic $RESTIC_QUIET check
|
||||||
if [ $status -ne 0 ]; then
|
status=$?
|
||||||
echo "E: Exit code was $status"
|
if [ $status -ne 0 ]; then
|
||||||
notify "Repository check of the backup failed!"
|
echo "E: Exit code was $status"
|
||||||
exit 5
|
notify "Repository check of the backup failed!"
|
||||||
|
exit 5
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "I: Skipping check step this time!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
notify "Backup finished!"
|
notify "Backup finished!"
|
||||||
|
|
Loading…
Reference in New Issue