You are not logged in.
Is there a better way to do this?
I noticed my cron.hourly only runs if cron is asked to restart at some point, so I added:
/etc/rc.d/crond restart
to /etc/rc.local
Does this make sense?
(the result is that at boot cron is asked to restart and so consequently the crons are run)
Last edited by tawan (2010-04-05 01:57:41)
Offline
This might be silly but: Have you put crond in /etc/rc.conf ?
Offline
for desktop computers it's more advisable to use anacron instead of cron. Imagine having cronjobs set to 2am. In case your PC is always switched off at 2am, these never get executed. anacron checks for skipped cronjobs when powering on your PC and executes them. cron basically only makes sense for machines running 24/7.
IIRC anacron picks up all the cronjobs defined in cron's configuration files, so switchin from cron involves no configuring afterwards
Offline
our new dcron does this as well; so no need for anacron.
Offline
our new dcron does this as well; so no need for anacron.
Yes that's right. However there are some bugs at the moment so @hourly and @daily jobs don't always run at the frequency they're supposed to. Just writing to say I'm aware of this and will fix as soon as I can squeeze some development time into an already-busy schedule.
Offline
what's the advantage of dcron as compared to anacron? I don't mean to be stubborn, just curious
Offline
dcron is a lightweight cron daemon with the anacron functionality (plus a bit more) rolled in.
Advantages: only one syntax to keep track of, only one set of files to configure, only one program to track bugs against, also there's someone here to listen to bug reports / feature requests (anacron development stopped at least five years ago).
On the other hand, if you've got an existing anacron setup that works for you, no need to break what you've got.
Offline
I thought anacron features the same advantages 1 to 3. Didn't know anacron is obsoleted, though. Thanks for the advice, so I'll stay clear of anacron
Offline
Well, if your scripts only need to run every N days, then you could set cron up to run anacron and do all the configuration in anacron. If you have any scripts that run at different frequencies, for example every hour, then you'd need to mess with crontabs as well.
Anacron isn't broken. But it isn't being developed, and I got no response when I sent a patch (a feature-enhancement) to the developers a year or two ago. (I don't remember whether I even was able to find a working email address...)
Offline