Index: cronrc
===================================================================
RCS file: /cvsroot/tiger/tiger/cronrc,v
retrieving revision 1.1
diff -a -u -w -r1.1 cronrc
--- cronrc	14 Jun 2002 08:51:31 -0000	1.1
+++ cronrc	18 May 2003 19:39:21 -0000
@@ -48,11 +48,11 @@
 #
 # Check for network configuration every Monday
 #
-3 * Mon		check_inetd check_exports check_aliases check_path check_cron check_anonftp check_printcap
+#3 * Mon		check_inetd check_exports check_aliases check_path check_cron check_anonftp check_printcap
 #
 # Check for strange file ownerships once a month
 #
-2 1 *         find_files 
+#2 1 *         find_files 
 #
 # Run a password cracker against the local passwords once a month
 # This is removed since a) it does not work and b) the functionality is
Index: tigercron
===================================================================
RCS file: /cvsroot/tiger/tiger/tigercron,v
retrieving revision 1.11
diff -a -u -w -r1.11 tigercron
--- tigercron	12 May 2003 20:11:06 -0000	1.11
+++ tigercron	18 May 2003 19:39:22 -0000
@@ -40,6 +40,12 @@
 #
 TigerInstallDir="."
 
+if [ "$1" == "--scripts" ]; then
+  # wait a comma separated list of scripts
+  script_list=$(echo $2 |sed -e "s/,/ /g")
+  shift;shift
+fi
+
 [ "$1" != "" ] && {
   case "$1" in
     -*);;
@@ -137,11 +143,27 @@
   fi
 }
 
+COUNTER="/var/log/tiger/cron.counter"
 
-$SED -e 's/#.*$//' -e '/^$/d' $ctrlfile |
+if [ -n "$script_list" ]; then
+  scripts=$script_list
+else
+  scripts=$($SED -e 's/#.*$//' -e '/^$/d' $ctrlfile |
 while read times doms days scripts
 do
   
+      # don't rely on hour provided by date if Rotated checks are enabled
+      if [ "$Tiger_CRON_Rotate_Checks" = "Y" ]; then
+        # don't change hour of monthly and weekly checks
+        # those should not be specified in cronrc
+        if [ "$doms" == "*" ] && [ "$days" == "*" ]; then
+          hour=0
+          [ -r "$COUNTER" ] && hour=$(( ($($CAT "$COUNTER") + 1)%24 ))
+          # update the counter
+          echo "$hour" > "$COUNTER".next
+        fi
+      fi
+
   hourok=0
 
   if [ "$times" != '*' ]; then
@@ -200,7 +222,12 @@
       dayok=1
     fi
     
-    [ $dayok -eq 1 ] && {
+        [ $dayok -eq 1 ] && echo -n $scripts ' '
+      }
+    done
+  )
+fi
+
       for script in $scripts
       do
 	outprefix="$LOGDIR/`$BASENAME $script`.out"
@@ -229,9 +256,6 @@
 	  $MV $outprefix.tmp $outprefix.1
 	  echo $outprefix
 	fi
-      done
-    }
-  }
 done |
 while read filename
 do
@@ -251,6 +275,9 @@
     $CAT $newfile
   fi
 done >> $WORKDIR/tigcron.diff.$$
+
+# update the counter for rotated cron checks
+[ "$Tiger_CRON_Rotate_Checks" = "Y" ] && [ -r "$COUNTER".next ] && mv "$COUNTER".next "$COUNTER"
 
 [ ! -n "$Tiger_Mail_RCPT" ] && Tiger_Mail_RCPT="root"
   
Index: tigerrc
===================================================================
RCS file: /cvsroot/tiger/tiger/tigerrc,v
retrieving revision 1.11
diff -a -u -w -r1.11 tigerrc
--- tigerrc	5 May 2003 13:18:39 -0000	1.11
+++ tigerrc	18 May 2003 19:39:22 -0000
@@ -286,3 +286,7 @@
 # the file database at /var/lib/dpkg?)
 #
 Tiger_DPKG_Optimize=Y
+#
+# Rotate tigercron hourly checks.
+# This can be usefull on system not running 24/24.
+Tiger_CRON_Rotate_Checks=Y
Index: debian/cron.d
===================================================================
RCS file: /cvsroot/tiger/tiger/debian/cron.d,v
retrieving revision 1.3
diff -a -u -w -r1.3 cron.d
--- debian/cron.d	26 Apr 2003 10:35:33 -0000	1.3
+++ debian/cron.d	18 May 2003 19:39:22 -0000
@@ -2,3 +2,5 @@
 # Regular cron jobs for the tiger package
 #
 0 * * * *      root    /usr/sbin/tigercron -q
+0 3 * * Mon    root    /usr/sbin/tigercron -q --scripts check_inetd,check_exports,check_aliases,check_path,check_cron,check_anonftp,check_printcap
+0 2 1 * *      root    /usr/sbin/tigercron -q --scripts find_files

