Someone wrote:

> Wishlist:  a djb replacement for Vixie cron.

Posit: he already has.

user@hypothetical$ cat /service/logrotate/run
#!/bin/sh

<logrotation commands>
exec /bin/sleep 86400

Granted, this is not cron in the traditional UNIX
let-every-user-schedule-arbitrary-tasks mentality, but I suspect this
could well replace cron for every relevant sysadminly task, and who on
a serious multi-user machine lets arbitrary users utilize cron anyway? :)
What's really needed in this instance is a program that, given an
execution schedule on the command line, figures out how long until the
next scheduled execution, and sleeps that long (sleepuntil).

Potential problem: clock shift (NTP resync, DST transitions) could confuse
it. Maybe it has to wake up (SIGALRM) periodically and recheck the time
until execution. Could get ugly.

Actual problem: The sleepuntil utility needs to run *first* in the ./run
script, otherwise when your machine starts, every scheduled program would
run once instantly, which is almost certainly not what you want. Oops.

Running cron-style services out of supervise has the additional advantage
of being able to stop the execution of the job via the standard daemontools
utilities, and having much firmer control over the environment that the
jobs run in, unlike modern cron.

--michael

Reply via email to