gabriel rosenkoetter on Wed, 18 Jul 2001 12:40:07 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Specify seconds in cron ?


On Wed, Jul 18, 2001 at 12:13:39PM -0400, Sandhitsu R Das wrote:
> Why do you say so ?

Because cron is totally inexact. It schedules a process to be run at
a specific time, but because of the way processor scheduling works
in any modern, Unix-like operating system, there's no kind of
microsecond, or even second, guarantee. A process scheduled even at
* * * * * won't necessarily start on the same second of every minute.
Vixie cron just wasn't designed to be that precise, it was designed
to deal with the give and take of standard Unix processor
scheduling.

However, I thought about this a little more, and what you really
want here is at, which does take second-grain scheduling on some
systems, though it doesn't appear to on Linux. That's a shame.

NetBSD's at(1) man page includes:

     -t      For both at and batch, the time may be specified in a language-
             neutral format consisting of:
                   CC      The first two digits of the year (the century).
                   YY      The second two digits of the year.  If YY is speci-
                           fied, but CC is not, a value for YY between 69 and
                           99 results in a CC value of 19.  Otherwise, a CC
                           value of 20 is used.
                   MM      The month of the year, from 01 to 12.
                   DD      The day of the month, from 01 to 31.
                   hh      The hour of the day, from 00 to 23.
                   mm      The minute of the hour, from 00 to 59.
                   SS      The second of the minute, from 00 to 61.

... but I see nothing similar in Linux, at least not on the Debian
system I have access to.

> I was trying to avoid coding. If I don't get anything else, I will.

You may have to. Or, at least, install a third-party cron or at.

-- 
       ~ g r @ eclipsed.net


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug