From 85ea4b7f90d54f48e0b3f0b7a71cd05983ed8e50 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 23 Oct 2014 11:56:40 +0200 Subject: [PATCH] Stderr if latest backup is half a day too old. --- backmeupscotty | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backmeupscotty b/backmeupscotty index df18802..3ee85c9 100644 --- a/backmeupscotty +++ b/backmeupscotty @@ -56,7 +56,7 @@ function latestTooOld { tstamp=$(echo $oldbackup | cut -d'-' -f1) if [ $(( $(date +%s) - $tstamp )) -lt \ - $(( $BACKUP_RUNEVERYNTHDAY*24*60*60 )) ] + $(( ($BACKUP_RUNEVERYNTHDAY*24+12)*60*60 )) ] then return 1 fi @@ -191,11 +191,11 @@ function backmeupscotty { done ssh255 $REMOTE_HOST exit - - if isNthDay; then + + if latestTooOld; then + scottyerror "The latest backup is too old." + elif isNthDay; then scottyinfo "This is the nth day." - elif latestTooOld; then - scottyinfo "The latest backup is too old." else scottyinfo "No backup has to be done. Exiting." exit 0 -- 2.39.5