SteveRoe has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to convince my boss that it will be best to simply port an existing perl application to w2k/IIS than to rewrite in VB. I already lost the UNIX vs. Windows and Apache vs. IIS argument :(.

There are a couple of crontab entries that run background jobs on the current UNIX implementation - does anyone have experience of the best (read simplest) way to reproduce cron's behaviour on Windows?

~steve

PS. I think my ".Net will work with any language including perl" argument is helping.

PPS. Yes, I have considered cygwin - but would rather hear about native windows services.

Replies are listed 'Best First'.
Re: cron on Windows
by davis (Vicar) on Aug 06, 2002 at 08:53 UTC
    Windows (2000) has the at command - a sort of cut-down cron, if you like. Type help at from a command prompt for more info.
    I've just created a job that uses the "Scheduled Tasks" feature - Control Panel->Scheduled Tasks. If I recall correctly, this is merely a front-end to at
    cheers
    davis
    Is this going out live?
    No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist
Re: cron on Windows
by mkmcconn (Chaplain) on Aug 06, 2002 at 10:15 UTC
      From what I read in the documentation this module does not work on windows:
      I quote from the manual <quote> One caveat: you'll need POSIX::setsid implemented on your architecture -- which means you can't use this module on Win32.</quote>
Re: cron on Windows
by Dog and Pony (Priest) on Aug 06, 2002 at 08:57 UTC
    Well, depending in what you need to do, how often etc, you have the AT command (type 'at /?' at a cmd line) and the task scheduler in w2k. These are not as versatile and easy to use as cron, specifically it is harder to for instance get them to do something every hour and suchlike, so those depend lots on your needs. I'd start there though, and see if it is enough.

    Going google returns a lot of possible alternatives, such as this, this and this (and tons more). I haven't tried any of these, but have had good luck in the past with similar products/projects - if I only could remember where and under what name. :)


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.
Re: cron on Windows
by AcidHawk (Vicar) on Aug 06, 2002 at 12:42 UTC
    The w2k ResourceKit has a gui front end to the at command also, if I remember correctly it is called WinAT and you can just tick and choose what you need to from there.

    -----
    Of all the things I've lost in my life, its my mind I miss the most.
Re: cron on Windows
by belg4mit (Prior) on Aug 06, 2002 at 21:13 UTC
    *sigh* what about a cron; in perl?

    UPDATE: Re PPS, oh native services? Then why ask in a perl forum? Although you could certainly use bcrond with one of the many available wrappers to turn a "normal" progam into a Win32 service. ( un, deux, trois, quatre )

    --
    perl -pew "s/\b;([mnst])/'$1/g"

      Thanks for all of the replies - seems like there are a lot of ways to go, with some trade-offs to mull over.

      While the at command would let me directly map over the cron entries, my gut feel is that Schedule::Cron or Schedule::At would do a better job of keeping everything together - then just need to get the SAs here to put one "run & forget" line in their RunAT scripts.