Re: cron jobs more often than daily
On Thu, 8 Jan 1998, Steve Greenland wrote:
> Here's the proposal:
> In addition to reading /etc/crontab, the cron daemon will also
> read each file in /etc/cron.d (chosen for similarity to init.d). Each
> of the files in cron.d is considered a crontab "fragment", and should
> be formatted exactly as /etc/crontab (i.e. with the username specified).
> The end result will be just as if cron read the result of
> cat /etc/crontab /etc/cron.d/*
Isn't it easier to have all packages that place something in /etc/cron.d
(or whatever is's called) call an update-cron script which conctenates all
files in /etc/cron.d/ into /etc/crontab? The /etc/crontab we have
currently would also have to me moved into /etc/cron.d/ . Perhaps
/etc/crontab could also contain some comment lines that say something like
"don't edit this file, instead edit the appropriate file in /etc/cron.d/".
The update-cron script could be very simple, like:
cat <<EOF > /etc/crontab.tmp
# DO NOT EDIT THIS FILE. It will be overwritten by the update-cron script.
# Instead, edit the appropriate file in /etc/cron.d and re-run update-cron .
cat /etc/cron.d/* >> /etc/crontab.tmp
mv /etc/crontab.tmp /etc/crontab
Advantage: cron doesn't need to be modified
> Packages requiring faster than daily intervals, or irregular
> intervals, should place the appropriate crontab fragment in
> /etc/cron.d/packagename. This file should be marked as conf file, so
> that the sysadmin may change it. The files in /etc/cron.d will be
> checked for changes (via stat()) every minute, just as /etc/crontab is;
> therefore there is no need for action in the postinst.
Disadvantage (perhaps) of my proposal: each package has to call
update-crom in both postinst and postrm.
I think there should be no modifications to cron that make Debian
incompatible with other unixes, if they can be avoided.
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to firstname.lastname@example.org .