Michael Handler writes:
 > 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.

No, you need a program which scans a directory looking for files with
a timestamp NOT in the future.  Whenever it encounters any of these,
it hands the file to the shell.  Presumably the last line in the file
either removes the file or runs a touch command to reschedule.

I'd go ahead and write this problem, but I'm not sure how portable are
future timestamps.  I know that tar complains about future timestamps,
but it sets them anyway.  Anything else?

 > 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.

Yup.

-- 
-russ nelson <[EMAIL PROTECTED]>  http://russnelson.com
Crynwr sells support for free software  | PGPok | "This is Unix...
521 Pleasant Valley Rd. | +1 315 268 1925 voice | Stop acting so helpless."
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | --Daniel J. Bernstein

Reply via email to