in reply to how to set alarm in perl

It's not clear to me whether you want to set an alarm in your long-running perl script to end it after 3 days, or to run another program that kills your long-running script after it's run 3 days. Can you clarify?

Replies are listed 'Best First'.
Re^2: how to set alarm in perl
by Anonymous Monk on Sep 11, 2006 at 08:43 UTC
    this is what i m need to do.i had script which submit tests to unix LSF. its expected that tests will end within 3 days.
    but in worse loading it may happen tests dont complete in 3 days, in that case i will set a alarm for 3 days and will kill tests after 3 days.
    if tests end with in three days i will create final report log.
    i m checking status of servers to find if all tests are done or not using bsub commands.
    in short i want
    ------ see if alarm is not expired ------ see serve load , if server load ==0 , all tests done , create final report. ------ if alam expired kill all tests. hope this explains what i need.
      No need for alarm, then. Just write what you want to have.

      Place your code which checks the server load into a loop which terminates when the time passed hits the timeout. Exit the loop if conditions for reporting are met. After the loop, do the reporting.

      Write your script. If you have questions around it, post it, and ask. See How do I post a question effectively?.

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}