http://www.perlmonks.org?node_id=471650

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/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