Re: Script for Sheduling jobs on NT
On Sat, Jul 28, 2001 at 01:56:46PM +0200, Ackim Chisha wrote: > Does any one already have a perl script for NT that I could use to run like > a cron job in unix. Am writing a scrip that I need to have running every 5 > minuteseveryday. Or is there a way I can write my script so that it runs > every 5 minutes. Task sheduler on NT looks like it cant help run my script > every 5minutes everyday. > > Any help will be appreciated. Three thoughts: 1. Schedule at jobs to run your script every five minutes. $script_path = 'c:\path\to\myscript.pl'; for $hour (0..23) { for ($min = 0; $min < 60; $min += 5) { $cmd = sprintf ("at %02d:%02d /e:m,t,w,th,f,sa,su %s", $hour, $min, $script_path); system($cmd); } } 2. Have your script run in an infinite loop. At the bottom of the loop, sleep until 5 minutes are up: $five_minutes = 5 * 60; while (1) { $start_time = time; do_stuff; sleep($five_minutes - (time - $start_time)); } 3. Search the net for a Windows-native cron program, of which I'm sure there must be a bunch. Walt PGP signature
re: Script for Sheduling jobs on NT
AT is part of the standard installation on NT4. There is no need to install it separately. If the schedule service is running on the remote machine, and your account has rights on it, just designate the remote machine between the AT and the time like this from command prompt: at \\remotemachine 23:30 /every:monday c:\tasks\myscript.pl Type at /? to get all the options. Steve H. -Original Message- From: SunDog [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 28, 2001 1:48 PM To: Ackim Chisha Cc: [EMAIL PROTECTED] Subject: Re: Script for Sheduling jobs on NT Hey Ackim, The NT Resoure Kit provides an "AT" scheduler ... Just install it, configure your command script and identify the run times ... Unless you do not have Local Admin access to this NT server, there is no need to re-write a scheduler ... regards SunDog = At 01:56 PM 7/28/01 +0200, you wrote: >Does any one already have a perl script for NT that I could use to run like >a cron job in unix. Am writing a scrip that I need to have running every 5 >minuteseveryday. Or is there a way I can write my script so that it runs >every 5 minutes. Task sheduler on NT looks like it cant help run my script >every 5minutes everyday. > >Any help will be appreciated. > >Thanks >Ackim > > > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Script for Sheduling jobs on NT
Almost right. Windows 2000 has a scheduler in the control panel, and you can set a single schedule to run every 5 minutes from a start time to a stop time every day by using a weekly schedule. This has a front end GUI, but still works with the legacy AT like in NT4. However using the AT may not be what you want to do for something to run every 5 minutes. However, many other programs that may be loaded on the computer have schedulers built into them (one good example is the SQLServerAgent with SQL 7 etc.) However, to schedule something on the local machine using at you can do this: at 23:30 /every:monday,tuesday,wednesday,thursday,friday,saturday,sunday c:\tasks\myscript.pl (example to schedule a single job to run at 11:30 pm every day). Works fine for something like that, but not too good for something you need to schedule every 5 minutes. However, as a possibility to handle that, you might include include a line as the last line in your script to schedule the next run for 5 minutes after after current time or something like that. Just use shell or back ticks to run the line to schedule the next run. Steve H. -Original Message- From: Steven Yarbrough [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 28, 2001 3:22 PM To: [EMAIL PROTECTED] Subject: Re: Script for Sheduling jobs on NT Windows NT/2000 built-in scheduler, the "at" program, will work, I believe, but if your script is to run every 5 minutes, you might simply use Perl's sleep command to time iterations of some loop. That way the script's process won't have to start and stop repeatedly. It will simply wait in the background until it's ready to run again. Steven Yarbrough ([EMAIL PROTECTED]) >Why don't you try the built-in scheduling program in NT? best bet. Then >have it run the specified script when you want. > > >- Original Message - >From: "Ackim Chisha" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Saturday, July 28, 2001 7:56 AM >Subject: Script for Sheduling jobs on NT > > >> Does any one already have a perl script for NT that I could use to run >like >> a cron job in unix. Am writing a scrip that I need to have running every >5 >> minuteseveryday. Or is there a way I can write my script so that it runs >> every 5 minutes. Task sheduler on NT looks like it cant help run my script >> every 5minutes everyday. >> >> Any help will be appreciated. >> >> Thanks >> Ackim >> >> >> >> >> -- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] > > >_ >Do You Yahoo!? >Get your free @yahoo.com address at http://mail.yahoo.com > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] -- _ "We are in the midst of husked coconuts; the basement is downstairs." Steven Yarbrough -- http://ebstern.freehosting.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Script for Sheduling jobs on NT
Windows NT/2000 built-in scheduler, the "at" program, will work, I believe, but if your script is to run every 5 minutes, you might simply use Perl's sleep command to time iterations of some loop. That way the script's process won't have to start and stop repeatedly. It will simply wait in the background until it's ready to run again. Steven Yarbrough ([EMAIL PROTECTED]) >Why don't you try the built-in scheduling program in NT? best bet. Then >have it run the specified script when you want. > > >- Original Message - >From: "Ackim Chisha" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Saturday, July 28, 2001 7:56 AM >Subject: Script for Sheduling jobs on NT > > >> Does any one already have a perl script for NT that I could use to run >like >> a cron job in unix. Am writing a scrip that I need to have running every >5 >> minuteseveryday. Or is there a way I can write my script so that it runs >> every 5 minutes. Task sheduler on NT looks like it cant help run my script >> every 5minutes everyday. >> >> Any help will be appreciated. >> >> Thanks >> Ackim >> >> >> >> >> -- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] > > >_ >Do You Yahoo!? >Get your free @yahoo.com address at http://mail.yahoo.com > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] -- _ "We are in the midst of husked coconuts; the basement is downstairs." Steven Yarbrough -- http://ebstern.freehosting.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Script for Sheduling jobs on NT
Why don't you try the built-in scheduling program in NT? best bet. Then have it run the specified script when you want. - Original Message - From: "Ackim Chisha" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, July 28, 2001 7:56 AM Subject: Script for Sheduling jobs on NT > Does any one already have a perl script for NT that I could use to run like > a cron job in unix. Am writing a scrip that I need to have running every 5 > minuteseveryday. Or is there a way I can write my script so that it runs > every 5 minutes. Task sheduler on NT looks like it cant help run my script > every 5minutes everyday. > > Any help will be appreciated. > > Thanks > Ackim > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Script for Sheduling jobs on NT
Hey Ackim, The NT Resoure Kit provides an "AT" scheduler ... Just install it, configure your command script and identify the run times ... Unless you do not have Local Admin access to this NT server, there is no need to re-write a scheduler ... regards SunDog = At 01:56 PM 7/28/01 +0200, you wrote: >Does any one already have a perl script for NT that I could use to run like >a cron job in unix. Am writing a scrip that I need to have running every 5 >minuteseveryday. Or is there a way I can write my script so that it runs >every 5 minutes. Task sheduler on NT looks like it cant help run my script >every 5minutes everyday. > >Any help will be appreciated. > >Thanks >Ackim > > > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]