From abcedb8ac252ef79eab6c0611ecf365abfe4d908 Mon Sep 17 00:00:00 2001 From: Gerald Young Date: Tue, 31 Dec 2013 15:11:47 -0500 Subject: [PATCH] Update check_crashplan_currency.sh The "T" in the file sets a time zone issue for my implementation. changing to a " " fixes this to my current time zone. --- check_crashplan_currency.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_crashplan_currency.sh b/check_crashplan_currency.sh index 375259a..e4a82a4 100755 --- a/check_crashplan_currency.sh +++ b/check_crashplan_currency.sh @@ -36,7 +36,7 @@ then fi lastBackupLine=`grep -n lastCompletedBackupTimestamp "$cpDirectory"` -lastBackupDateString=`echo $lastBackupLine | awk -F lastCompletedBackupTimestamp= '{print $NF}' | sed 's/.\{5\}$//' | sed 's/%//'` +lastBackupDateString=`echo $lastBackupLine | awk -F lastCompletedBackupTimestamp= '{print $NF}' | sed 's/.\{5\}$//' | sed 's/%//' | sed 's/T/ /'` lastBackupDate=$(date -j -f "%Y-%m-%eT%H\:%M\:%S" "$lastBackupDateString" "+%s" ) diff=$(( $currentDate - $lastBackupDate)) @@ -54,4 +54,4 @@ elif [ "$diff" -gt "$warnSeconds" ]; then fi printf "OK - $cpDirectory has been backed up within the last $warnMinutes minutes.\n" -exit 0 \ No newline at end of file +exit 0