Here a little daemon that runs my Perl FTP program with different job cards.
It runs every 5 minutes.  

#!/usr/bin/perl -w
use strict;
use POSIX;

# Start the loop for the daemon....
while(1) {
        my(@now) = localtime();
        my($today) = POSIX::strftime( "%m/%d/%Y", @now);
        my($time) = POSIX::strftime( "%H:%M", @now);
        print "Running 5 minute jobs | $today | $time\n"; 

        system ( 'perl newftp2.pl gep_card.xml' );
        system ( 'perl newftp2.pl gel_card.xml' );
        system ( 'perl newftp2.pl met_card.xml' );
        system ( 'perl newftp2.pl nor_card.xml' );
        system ( 'perl newftp2.pl pet_card.xml' );              
        system ( 'perl newftp2.pl th_jua_card.xml' );   
        system ( 'perl newftp2.pl th_del_card.xml' );   
        system ( 'perl newftp2.pl th_chi_card.xml' );        
        
        sleep 300;  # 5 minute intervals                   
}

I used to do this with NT Scheduler (if you have to do it that way go to
Advanced options and you can repeat every x minutes) but I found that the
Perl daemon was easier.  Also since my production box is my pc (ack) I don't
have a MS Window popping up every 5 minutes like you will have with the
scheduler.

Hope this helps...

Joel

> -----Original Message-----
> From: Scott [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 07, 2002 10:44 AM
> To: [EMAIL PROTECTED]
> Subject: perl sleep
> 
> 
> I have been asked to rewrite a ftp process in perl on Win32.  
> The program 
> will scan a directory
> every five minutes and if a file exists, it will ftp the file 
> to a server.
> 
> My question is, has any had an experience using the Windows 
> Task Scheduler 
> to do a every 5
> minute process or do you think it would be best to have perl 
> sleep for 5 
> minutes?
> 
> Thanks,
> 
> -Scott
> 
> 
> -- 
> 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]

Reply via email to