Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

executing a script at a specific time

by Anonymous Monk
on Jul 01, 2005 at 11:08 UTC ( #471650=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I would like to run a clean up script each day. Is it possible to set the script to run at say 8pm each and every Friday? Thanks

Comment on executing a script at a specific time
Re: executing a script at a specific time
by spurperl (Priest) on Jul 01, 2005 at 11:11 UTC
    Yes, it is possible, and you don't need Perl for it.

    On Unixes look for cron. On Windows, you have System Tools -> Scheduled tasks.

Re: executing a script at a specific time
by polettix (Vicar) on Jul 01, 2005 at 11:14 UTC
    In Unix, you can use crontab with something like:
    0 20 * * fri /path/to/your/script.pl
    In Win32, you can either have a script that sleeps "the correct amount of time" before activating, then it goes to sleep again, or you could roll your own service with Win32::Daemon (note: it's outside CPAN). I'd prefer a third way: swap the OS :)

    Flavio
    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Don't fool yourself.
Re: executing a script at a specific time
by Ben Win Lue (Friar) on Jul 01, 2005 at 11:14 UTC
    The easiest way to do this would be not in the perl-script, but to start the script as a cron-job in unix or via the scheduler in Windows XP.
      thanks for pointing me in the right direction

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://471650]
Approved by polettix
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-07-28 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (209 votes), past polls