From 5993210ddd7441b872f5801ed366a268e677347d Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 11 Aug 2020 14:17:53 +0200 Subject: [PATCH] Only verify the backup every 4 weeks --- restic-cron | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/restic-cron b/restic-cron index 09d6f06..73d6c5e 100755 --- a/restic-cron +++ b/restic-cron @@ -53,14 +53,18 @@ if [ $status -ne 0 ]; then exit 3 fi -# Verify the backup -test -z "$RESTIC_QUIET" && echo "I: Check step…" -restic $RESTIC_QUIET check -status=$? -if [ $status -ne 0 ]; then - echo "E: Exit code was $status" - notify "Repository check of the backup failed!" - exit 5 +# Verify the backup every 4 weeks +if [ $(($(date +%W) % 4)) = 0 ]; then + test -z "$RESTIC_QUIET" && echo "I: Check step…" + restic $RESTIC_QUIET check + status=$? + if [ $status -ne 0 ]; then + echo "E: Exit code was $status" + notify "Repository check of the backup failed!" + exit 5 + fi +else + echo "I: Skipping check step this time!" fi notify "Backup finished!"