[PC-BSD Commits] r21495 - pcbsd/branches/9.1/src-sh/warden/scripts/backend

svn at pcbsd.org svn at pcbsd.org
Thu Feb 14 11:01:18 PST 2013


Author: kris
Date: 2013-02-14 19:01:17 +0000 (Thu, 14 Feb 2013)
New Revision: 21495

Modified:
   pcbsd/branches/9.1/src-sh/warden/scripts/backend/cronsnap.sh
Log:

Backport cron fixes to warden for 9.1



Modified: pcbsd/branches/9.1/src-sh/warden/scripts/backend/cronsnap.sh
===================================================================
--- pcbsd/branches/9.1/src-sh/warden/scripts/backend/cronsnap.sh	2013-02-14 18:56:13 UTC (rev 21494)
+++ pcbsd/branches/9.1/src-sh/warden/scripts/backend/cronsnap.sh	2013-02-14 19:01:17 UTC (rev 21495)
@@ -32,18 +32,18 @@
   zdate=`date +%Y%m%d-%H%M%S`
   if [ "$CRONFREQ" = "daily" ] ; then
      #echo "Checking for daily snapshots to ${jIP}..."
-     today=`date +%Y%m%d`
-     lastsnap=`echo $lastsnap | cut -d '-' -f 1`
+     today=`date +%Y-%m-%d`
+     lastsnap=`echo $lastsnap | cut -d '-' -f 1-3`
      if [ "$today" != "$lastsnap" ] ; then
         needSnap=1
      fi
   else
   # Hourly
      #echo "Checking for hourly snapshots to ${jIP}..."
-     today=`date +%Y%m%d`
+     today=`date +%Y-%m-%d`
      hour=`date +%H`
-     lastday=`echo $lastsnap | cut -d '-' -f 1`
-     lasthour=`echo $lastsnap | cut -d '-' -f 2 | cut -c 1-2`
+     lastday=`echo $lastsnap | cut -d '-' -f 1-3`
+     lasthour=`echo $lastsnap | cut -d '-' -f 4 | cut -c 1-2`
      if [ "$today" != "$lastday" -o "$hour" != "$lasthour" ] ; then
         needSnap=1
      fi



More information about the Commits mailing list