Re: Crontab question



The Natural Philosopher <a@xxx> wrote:
Floyd L. Davidson wrote:
"gmax2006" <mapsetah2000-maillist5@xxxxxxxx> wrote:
Hi,

I have this entry in my crontab schedules:

*/1 * * * * date >> /home/max/cron.log

Means run this every minute.

The problem is if I do any modification on this entry, crontab
continues to follow the old entry for four or six minutes then read the
changes.

I tried to use crontab -e and save the file, but it doesn't work
and still it takes 2-4 minutes to crontab follow the new entry!

I guess there is some caching mechanism is going on, but how can I
force the crontab daemon to read the schedule file immediately?

Is there any standard troubleshooting procedure/command/toll for
crontab?
Cron sends you email if there is output from the program.
Whatever, the delay is not a "caching mechanism", it is just a
matter of how often the cron daemon runs stat(2) on the various
crontab files. Certainly once ever few minutes is reasonable...
If you want to force it, check the man page for the cron daemon
(cron or crond or some such). There are several versions of
cron in use, and I don't know if any of them allow using a
signal for for reconfiguration, but perhaps one does.
Regardless, you'd have to be root, and if you can be root you
also have the simple option of killing and restarting the cron
daemon, which has the same effect.

I am *fairly* sure that a KILL -HUP signal will force the cron
daemon to re-read its config files....ISTR having this issue
myself years ago..

Depends on which cron... there are several.


--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@xxxxxxxxxx
.



Relevant Pages

  • Re: How init process will call the SNTP client software?
    ... Much too low-level. ... Most people would run it from cron, putting it in crontab ... Cron is one of those things that Just Run. ... Ntpd (the full daemon) is another of those things that just run, ...
    (comp.protocols.time.ntp)
  • RE: crond not found
    ... Crontabs does not contain the cron daemon: ... Group: System Environment/Base Source RPM: ... The crontabs package contains root crontab files. ...
    (RedHat)
  • Re: crontab
    ... >>I have scheduled a task by configuring crontab. ... >>and the mail contents are simply stating the successfull execution of ... >>the cron job. ... If MAILTO is ...
    (comp.os.linux.development.system)
  • Re: cron + mails
    ... > the entry is created as root with crontab -e. ... In this case cron can never send me an email. ...
    (comp.os.linux.misc)
  • Re:crontab bug?
    ... When I edit my crontab and then save it, ... needing to restart cron for every new crontab isnt normal, ... so it may be a bug, or you are doing it wrong. ... you file a bug on cron (see debian website for that) ...
    (Debian-User)