Re: How Can I Schedule A Perl Script?

From: Michael Ott (michael_at_zolnott.de)
Date: 07/18/05

  • Next message: Douglas Ward: "Re: Debian or Ubuntu Dilemma"
    Date: Mon, 18 Jul 2005 06:12:14 +0100
    To: pvbedu-debian@yahoo.com.br
    
    
    

    Hello

    > I have a perl script that needs to be runned each 30
    > minutes, how can I do this? Can I use cron? If so what
    > would the configuration line would be? The path to the
    > script is /home/user/doc/id.pl
    You can use cron
    crontab -e as normal user and
    0,30 * * * * /home/user/doc/id.pl

    or you can use sleep
    sleep EXPR
    sleep
    Causes the script to sleep for EXPR seconds, or forever if no EXPR.
    May be interrupted by sending the process a SIGALRM. Returns the
    number of seconds actually slept. You probably cannot mix alarm()
    and sleep() calls, because sleep() is often implemented using
    alarm().

    On some older systems, it may sleep up to a full second less than
    what you requested, depending on how it counts seconds. Most modern
    systems always sleep the full amount.

    For delays of finer granularity than one second, you may use Perl's
    syscall() interface to access setitimer(2) if your system supports
    it, or else see select() below.

    See also the POSIX module's sigpause() function.

    CU
             
      Michael
              
    --
               Michael Ott, e-mail: michael@zolnott.de, www.zolnott.de
    I am registered as user #275453 with the Linux Counter, http://counter.li.org.

    
    

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

    • application/pgp-signature attachment: stored

  • Next message: Douglas Ward: "Re: Debian or Ubuntu Dilemma"

    Relevant Pages

    • Re: Microfocus Cobol "SLEEP" routine
      ... The program using this is a background program and can be ... run via cron too. ... Is there a way in MF Cobol to pause program execution (sleep) for, ... Vaclav Snajdr ...
      (comp.lang.cobol)
    • Re: Timer Task?
      ... "sleep" for scheduling? ... I use cron for most of these periodic, ... in most cases "sleep" is a perfectly acceptable way to do it. ... guarantee is that it will be *at least* 10 seconds. ...
      (comp.lang.ruby)
    • Re: Leaving a Computer Running ?
      ... > when to perform the nightly maintenance. ... I turn my computer off over night so I can sleep. ... This would mean missing the ... cron stuff but since most of it is done by periodic, I have a script that is ...
      (freebsd-questions)
    • Re: OT. Cron jobs
      ... We have a perl script that needs to run 4 times a minute. ... cron or is there an easier way to do this within the Perl script itself? ... Your best best would be to create a script that continuously forks and ... Since sleep only handle's whole seconds, you'll want to take a look at ...
      (perl.beginners)
    • [SLE] RANT: Advantages of Dual Core
      ... when my computer has gone to sleep when running the cron update. ... and despite that this function is reduntant function from the ... all manuals, which nobody reads anymore. ...
      (SuSE)