On 3/10/07, Mike Blezien <[EMAIL PROTECTED]> wrote:
Hello,

Sorry for the OT question, but couldn't find the info I was looking for and
thought could get a quick answer from the list.

We have a perl script that needs to run 4 times a minute. Can this be done via
cron or is there an easier way to do this within the Perl script itself? This 4
times a minute every day.


Mike,

As far as I know, cron doesn't have control finer-grained than a minute.

Your best best would be to create a script that continuously forks and
then sleeps for 15 seconds. See the docs for your system's deamon
management service (init on *ix, launchd on OS X) to find out how to
make sure it stays alive.

Since sleep only handle's whole seconds, you'll want to take a look at
Time::HiRes if you really need to execute exactly four times every
minute. That way you can time the fork() call and adjust the sleep
microseconds accordingly. Otherwise, you'll eventually get some
accumulated error in the sleep cycle. Not much, of course, but it
sounds like precision counts here.

HTH,

-- jay
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.downloadsquad.com  http://www.engatiki.org

values of β will give rise to dom!

Reply via email to