OS: SuSE 9.3 Pro I found my cron.daily files were running at all sorts of times of day in 9.3 (several systems) and finally found a message posted earlier this year that told how to fix it by removing the /var/spool/cron/lastrun/cron.daily file at the time you wanted it to run - one minute. I set mine to run at 4:00 AM (0800 UTC) and it did so the first day but then ran at 0415 the second day, 0430 the third, etc. What causes this creep? Am I going to have to run a cron.weekly job to reset cron.daily? Thank you, Lucky Leavell
On Monday 08 August 2005 7:13 pm, Lucky Leavell wrote:
It's a known problem. Check the archives for a solution. http://lists.suse.com/archive/suse-linux-e/2005-May/1097.html Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.11.4-21.8-default x86_64 SuSE Linux 9.3 (x86-64)
On Saturday 13 August 2005 05:46, Lucky Leavell wrote:
The whole solution is not given in any one message. You need to look at the whole thread to figure it out. Taken together, the following two messages explain what needs to be done... After making the changes to /usr/lib/cron/run-crons shown in: http://lists.suse.com/archive/suse-linux-e/2005-May/1096.html run the "at" command in: http://lists.suse.com/archive/suse-linux-e/2005-May/1112.html (Adjust tim to your liking.) The trick is to remove the file /var/spool/cron/lastrun/cron.daily one minute before the time at which you want the daily cron job to run.
Op zaterdag 13 augustus 2005 14:03, schreef Robert Paulsen:
http://susewiki.org/index.php?title=Schedule_cron_daily -- Richard Bos Without a home the journey is endless
On Sat, 13 Aug 2005, Robert Paulsen wrote:
I did that after editing the /usr/lib/cron/run-crons file as indicated in the same thread. I even tried restarting cron BUT cron.daily still won't run after the first time after removing the /var/spool/cron/lastrun/cron.daily file. If this is supposed to be easier than the old crontab, it isn't! Thnak you , Lucky
On Sunday 14 August 2005 6:57 pm, Lucky Leavell wrote:
Are you absolutely positive you changed /usr/lib/run-crons to match what was posted in the thread, in particular you needed to catch those instances that changed to -cmin from -ctime test -e $SPOOL/$BASE && { case $BASE in cron.hourly) TIME="-cmin +60 -or -cmin 60" ;; cron.daily) TIME="-cmin +1440 -or -cmin 1440" ;; cron.weekly) TIME="-cmin +10080 -or -cmin 10080" ;; cron.monthly) NOW=`date +%s` LASTMONTH=`date -d "last month" +%s` DIFF=`expr '(' $NOW - $LASTMONTH ')' / 86400` TIME="-ctime +$DIFF" ;; esac Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.11.4-21.8-default x86_64 SuSE Linux 9.3 (x86-64)
On Sun, 14 Aug 2005, Scott Leighton wrote:
Aha! That is it [I hope]! I changed the numbers but not the -ctime to -cmin. We'll see.... (I still don't see the advantage of using crontab to run the run-crons script which then runs the various cron.x scripts. It would seem to be much easier to see what is going on at a glance running, for example, cron.daily at the specified time direct from the crontab without having to go through all these other contortions just to get it to run when I want it to. In fact, I may just do that and comment out the run-crons entry. Comments? Thank you, Lucky
On Sunday 14 August 2005 7:40 pm, Lucky Leavell wrote:
Aha! That is it [I hope]! I changed the numbers but not the -ctime to -cmin. We'll see....
You are not alone, I made the same mistake myself first time I tried to implement the fix :) Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.11.4-21.8-default x86_64 SuSE Linux 9.3 (x86-64)
Lucky, On Sunday 14 August 2005 19:40, Lucky Leavell wrote:
The reason for doing it they way SUSE Linux does it is that many SUSE installations do not run 24 hours-per-day, and thus picking a fixed time to run daily or weekly cron jobs would fail on many user's systems. As it is, if the system is not up when the appointed hour arrives, the periodic tasks will still be run as soon after the scheduled time as the system is again up and running.
...
Lucky
Randall Schulz
On Monday 08 August 2005 7:13 pm, Lucky Leavell wrote:
It's a known problem. Check the archives for a solution. http://lists.suse.com/archive/suse-linux-e/2005-May/1097.html Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.11.4-21.8-default x86_64 SuSE Linux 9.3 (x86-64)
On Saturday 13 August 2005 05:46, Lucky Leavell wrote:
The whole solution is not given in any one message. You need to look at the whole thread to figure it out. Taken together, the following two messages explain what needs to be done... After making the changes to /usr/lib/cron/run-crons shown in: http://lists.suse.com/archive/suse-linux-e/2005-May/1096.html run the "at" command in: http://lists.suse.com/archive/suse-linux-e/2005-May/1112.html (Adjust tim to your liking.) The trick is to remove the file /var/spool/cron/lastrun/cron.daily one minute before the time at which you want the daily cron job to run.
Op zaterdag 13 augustus 2005 14:03, schreef Robert Paulsen:
http://susewiki.org/index.php?title=Schedule_cron_daily -- Richard Bos Without a home the journey is endless
On Sat, 13 Aug 2005, Robert Paulsen wrote:
I did that after editing the /usr/lib/cron/run-crons file as indicated in the same thread. I even tried restarting cron BUT cron.daily still won't run after the first time after removing the /var/spool/cron/lastrun/cron.daily file. If this is supposed to be easier than the old crontab, it isn't! Thnak you , Lucky
On Sunday 14 August 2005 6:57 pm, Lucky Leavell wrote:
Are you absolutely positive you changed /usr/lib/run-crons to match what was posted in the thread, in particular you needed to catch those instances that changed to -cmin from -ctime test -e $SPOOL/$BASE && { case $BASE in cron.hourly) TIME="-cmin +60 -or -cmin 60" ;; cron.daily) TIME="-cmin +1440 -or -cmin 1440" ;; cron.weekly) TIME="-cmin +10080 -or -cmin 10080" ;; cron.monthly) NOW=`date +%s` LASTMONTH=`date -d "last month" +%s` DIFF=`expr '(' $NOW - $LASTMONTH ')' / 86400` TIME="-ctime +$DIFF" ;; esac Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.11.4-21.8-default x86_64 SuSE Linux 9.3 (x86-64)
participants (5)
-
Lucky Leavell
-
Randall R Schulz
-
Richard Bos
-
Robert Paulsen
-
Scott Leighton