Hi

I'm trying to get this to work in perl. 

I want to start a unix process send it to a log file. Then at midnight kill it and 
restart it, with the date at the top.

I'm starting with the following but the intial start of the proccess is not working 
right:

#!/bin/perl
$date = `date | awk '{print $4}'`;
$snoop = "/usr/sbin/snoop";
$filename = "`date +%y%m%d%H%M`.sno";
$logfile = "/opt/$filename";
$pid = `/bin/pgrep snp.pl`;
 
system("/usr/sbin/snoop -d ge0 -ta >> $logfile &");                                    
                                                              
 
until ("1" eq "0"){
if ($date == "00:00:00"){
system("/bin/pkill -P $pid");
print "=========== `date` ==================\n" > $logfile;
system("/usr/sbin/snoop -d ge0 -ta >> $logfile &");
}
  }


Any suggestions would be helpfull. 
thanks
rob

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to