[arch-general] [arch-dev-public] Cron

Jim Pryor lists+arch-general at jimpryor.net
Mon Jan 4 07:00:00 EST 2010


On Mon, Jan 04, 2010 at 12:37:05PM +0100, Heiko Baums wrote:
> Am Mon, 4 Jan 2010 10:51:29 +0100
> schrieb Dieter Plaetinck <dieter at plaetinck.be>:
> 
> > When a crontab is missed due to system downtime, sometimes you want
> > the crontab to be done when the system boots up, but sometimes you do
> > not want that at all. (eg a cleanup crontab that should never run
> > during peak hours)
> > 
> > would be nice if the choosen cron solution supports a certain marker
> > per cron entry where you can define the behavior you want.
> 
> That's exactly what you can do with fcron. In crontab you have to
> explicitly tell fcron to run cronjobs which should have run during
> downtime at bootup. If I recall correctly you have to prefix these
> lines with an "@". Otherwise they are handled like in dcron.
> 
> The scripts in /etc/cron.hourly etc. are executed at bootup if the
> system was down when they should be running. But you can delete or chmod
> 600 them or just comment the commands out.

Hi, I'm the author/maintainer of yacron. It handles @daily, @weekly,
@reboot etc. flags. It also handles more fine-grained instructions,
like "try to run once a day, but only between the hours of 2-6 am"
(that's not how you word the instruction, but that's what it does).

It handles the /etc/cron.d scripts automatically. The /etc/cron.hourly
etc scripts are handled the same way dcron handles them, by having
lines like this in the system crontab:

@hourly		ID=sys-hourly	cd / && /usr/bin/run-parts --report /etc/cron.hourly

fcron is more powerful but it's also a lot more complex, more complexity
than I needed. I forked dcron into yacron because I thought with a
little work I could add the extra features I needed but still keep to
the tiny codebase. At this point, the upside of yacron is that
simplicity (for however much you value it). The downside is---I'll be
honest---not many people have been using it. But then I've
had no problem reports, the code is really tiny and I tested/scrutinized
my changes carefully, and the dcron starting point is quite mature.

-- 
Jim Pryor
profjim at jimpryor.net


More information about the arch-general mailing list