[PC-BSD Commits] r21116 - pcbsd/current/src-sh/warden/scripts/backend

svn at pcbsd.org svn at pcbsd.org
Wed Jan 23 12:28:25 PST 2013


Author: kris
Date: 2013-01-23 20:28:24 +0000 (Wed, 23 Jan 2013)
New Revision: 21116

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

Fix daily ZFS snapshost creation via cron



Modified: pcbsd/current/src-sh/warden/scripts/backend/cronsnap.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/cronsnap.sh	2013-01-23 18:59:02 UTC (rev 21115)
+++ pcbsd/current/src-sh/warden/scripts/backend/cronsnap.sh	2013-01-23 20:28:24 UTC (rev 21116)
@@ -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