Bug 196746

Summary: run-crons should allow specification of fixed times for running jobs
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Alan Iwi <A.M.Iwi>
Component: BasesystemAssignee: Klaus Singvogel <kssingvo>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Alan Iwi 2006-08-03 08:30:30 UTC
Here is an excerpt from /etc/crontab on a RedHat system:

01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

As you can see, these jobs will run at a fixed time of hour / day / week / month.

By contrast, the run-crons on SUSE potentially runs jobs every hour, and they actually run whenever there is a certain elapsed time since the job was last run.  Although this may be useful in certain circumstances (e.g. a machine which has a lot of down-time), I find it unhelpful when some of the cron.daily jobs run during office hours, particularly updatedb which does a disk-intensive "find".  It would be much better in this case to schedule these to happen at fixed times, in particular so that cron.daily scripts run during the night.  So personally I have copied the run-parts script and /etc/crontab entries from the RedHat system, and commented out run-crons from /etc/crontab.

I am not suggesting that you force this behaviour for everybody, but at least make it a configurable option please.

Many thanks.
Comment 1 Michael Gross 2006-08-03 13:13:04 UTC
You sure can setup cron that way yourself. What you propose is an Enhancement.
Klaus, please decide.
Comment 2 Klaus Singvogel 2006-08-03 13:37:07 UTC
There exists a mechanism to do so.

You can delete files (or change there modification time) in /var/spool/cron/lastrun/cron.daily at specific time to let cronjobs start later.
http://susewiki.org/index.php?title=Scheduling_daily_cron_jobs

*** This bug has been marked as a duplicate of bug 114761 ***