various fixes
[distro-setup] / ziva-backup-check
index 664750d91b0b7022fde344cecf1e680449ccd15d..849453d758bb59e674147f9ac0397e3c42b62304 100755 (executable)
@@ -18,7 +18,6 @@ fi
 
 
 ## begin check on btrbk
-now=$(date +%s)
 age_limit_sec=$(( 60 * 60 * 50 )) # 50 hours
 for prefix in root boot; do
   vol=${prefix}_ubuntubionic
@@ -40,7 +39,7 @@ for prefix in root boot; do
     err "could not find latest snapshot for $svp among ${snaps[*]}"
     exit 1
   fi
-  if (( last_snap_sec < now - age_limit_sec )); then
+  if (( last_snap_sec < EPOCHSECONDS - age_limit_sec )); then
     err vol $vol last backup older than 50 hours: $last_snap
   fi
 done