Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 chilling in the Monastery: (10)
As of 2015-07-06 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (77 votes), past polls