]> git.treefish.org Git - backmeupscotty.git/commitdiff
Stderr if latest backup is half a day too old.
authorAlexander Schmidt <alex@treefish.org>
Thu, 23 Oct 2014 09:56:40 +0000 (11:56 +0200)
committerAlexander Schmidt <alex@treefish.org>
Thu, 23 Oct 2014 09:56:40 +0000 (11:56 +0200)
backmeupscotty

index df18802d226b8b3e9079458edf2870a1ecac5912..3ee85c91ba37541eb04d831d78fba98a09ca4868 100644 (file)
@@ -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