Date: Sun, 2 Jan 2000 23:02:56 -0600 (CST) From: Ryan Thompson <freebsd@sasknow.com> To: Mitch Collinsworth <mkc@Graphics.Cornell.EDU> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Huge crontab jobs are not run Message-ID: <Pine.BSF.4.10.10001022247510.36683-100000@sasknow.com> In-Reply-To: <200001030033.TAA07780@benge.graphics.cornell.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2 Jan 2000, Mitch Collinsworth wrote: > > >> > Did you kill -HUP cron? If you didn't do this (or reboot the system), > >> > your job won't run. > >> > >> According to the manpage, you don't need to: > >> > >> | Additionally, cron checks each minute to see if its spool directory's > >> | modtime (or the modtime on /etc/crontab) has changed, and if it has, cron > >> | will then examine the modtime on all crontabs and reload those which have > >> | changed. Thus cron need not be restarted whenever a crontab file is mod- > >> | ified. Note that the crontab(1) command updates the modtime of the spool > >> | directory whenever it changes a crontab. > > > >Hmm... I stand corrected :-) I haven't looked at than man page for quite > >some time. Anyway, kill -HUP can't hurt, and might actually kick a few > >things into shape if modtimes get set incorrectly :-) > > > ><ASIDE> > > Isn't checking all crontabs every minute kind of a waste of good > > resources in many cases? > > I guess you *still* haven't looked at cron(8) in quite some time. It > also states that the every minute check is done on the modtime of the > directory containing the per-user crontabs and the individual files > are only checked if the directory modtime has changed. So in the > typical nothing-has-changed case, only two checks are done, one on > /etc/crontab and one on the spool directory. > > Anything else we can read to you? :-) > > -Mitch Ha! It looks like *you* didn't read the rest of my message :-) I did indeed read both cron(8) and parts of cron.c to confirm / clarify the built-in behaviour. Only after doing that did I post my message and state that there was no obvious way to disable the checks without source modifications. Even the "nothing-has-changed case", as you mentioned, still has two superfluous checks if and only if changes are summoned with kill -HUP. I'm not terribly worried about it, but I tend to be a bit of an optimization fanatic sometimes... always looking for something to tweak a bit :-) For most sysadmins, removing the checks would just mean another kill -HUP to forget and flood -questions about. For me, though, it's something to muck around with for a while when I need a break from DBI :-) -- Ryan Thompson <ryan@sasknow.com> 50% Owner, Technical and Accounts Phone: +1 (306) 664-1161 SaskNow Technologies http://www.sasknow.com #106-380 3120 8th St E Saskatoon, SK S7H 0W2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10001022247510.36683-100000>