Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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
[stevieb]: it is exceptionally difficult I'm finding to debug a dist that is x-platform, where on each platform you're wrapping a different binary. Trying to co-ordinate a successful test run where tests are extensive is a nightmare, especially when the dist...
[stevieb]:'re testing is a test system itself. 10+ documented issues fixed, another half dozen found while fixing the original ones. I'm getting there...
[stevieb]: Then throw in changes to Windows that throws everything you trusted right out the window.
[shmem]: that's why it is called "Windows"
[stevieb]: shmem thanks for the 'insight' :P
[shmem]: good thing that Sun already took "OpenWindows", otherwise I'd not stop to shudder imagining an "OpenWindows" from MS
[shmem]: more garbage in, more garbage out that would be
[stevieb]: I found that win10 broke a C# library I was using for one project while enhancing tests for a Perl dist, which breaks other Perl dists, and I'm about to throw my hands up on berrybrew. win2k12 broke one thing, win10 breaks something...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-03-28 22:02 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (342 votes). Check out past polls.