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