Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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

Replies are listed 'Best First'.
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/
    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 :)

    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://471650]
Approved by polettix
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2018-01-21 17:19 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (228 votes). Check out past polls.