Mailinglist Archive: opensuse (4570 mails)

< Previous Next >
Re: [SLE] Change the time that cron.daily is run
  • From: "Carlos E. R." <robin1.listas@xxxxxxxxxx>
  • Date: Mon, 28 Nov 2005 19:26:27 +0000 (UTC)
  • Message-id: <Pine.LNX.4.61.0511281451300.15924@xxxxxxxxxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


The Sunday 2005-11-27 at 17:49 -0800, Randall R Schulz wrote:

> > It has been this way for years.
>
> That's a non-sequitur. The fact that a behavior is old doesn't mean it
> could not bear improvement.
>
> I mildly dislike the current behavior (it's insufficiently stable and
> not subject to my direct control) and would like to see a means of
> explicitly configuring the nominal time at which these housekeeping
> actions take place. The fact that it actively tries to catch up if it
> misses a scheduled run is good, of course. And I can see why for some
> people adapting permanently to that time might be good, based on the
> inference that if the system wasn't up at, say, 4:00 AM one day, it may
> not be an always-on system and a different time for daily chores should
> be chosen. But for those who do run an always-on system, shifting the
> scheduled time after missing one scheduled run is less the optimal, to
> say the least.

As a quick "solution", I think you can simply remove the flag file a pair
of minutes before your prefered time for the runs to occur - not, as I
thought previously, touching that file. Ie, if you delete
'/var/spool/cron/lastrun/cron.daily' at 1:28 AM, it will run at 1:30 AM;
this can be done as a cronjob, or with the command "at" for one shot.

As an alternative, if you have a preferred timeframe when you'd like these
daily chores to run, would be to edit the crontab entry (in
'/etc/crontab'). Right now (SuSE 9.3) I have:

- -*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1


If I wanted it to only run somewhere in the early hours, I could use:

- -*/15 0-6 * * * root test ....

but then, cron.hourly would not run during the day.


Else, as there are people here fluent with script writing, someone could
think of a modification of the /usr/lib/cron/run-crons script to run at
certain prefered hours, and/or not to run at certain hours, as a variable
in '/etc/sysconfig/cron' perhaps.



- --
Cheers,
Carlos Robinson

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFDi1lotTMYHG2NR9URAvHpAKCFWr+IgbvkSrWvckKTkAUWVyfYVACeJwyh
eeeAIO9Vux5fvsbgfE4GjEM=
=/5tf
-----END PGP SIGNATURE-----


< Previous Next >