From: Alexander Schmidt Date: Thu, 23 Oct 2014 09:56:40 +0000 (+0200) Subject: Stderr if latest backup is half a day too old. X-Git-Url: https://git.treefish.org/~alex/backmeupscotty.git/commitdiff_plain/85ea4b7f90d54f48e0b3f0b7a71cd05983ed8e50 Stderr if latest backup is half a day too old. --- 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