I have a perl script that runs on a win2k machine using activestate perl. The script is runs nightly to execute a system command to export logs from binary to text (checkpoint fw1). I am using the Time::localtime module to record the start and stop time of the script to a file. The problem is that the start and stop time are the exact same and I know the export process is taking longer than that.
Here is the code as it runs now:
***********************sta
rt script********************
**
use warnings;
use strict;
use Time::localtime;
my $workdir = "d:\\fwlog\\work";
my $logdir = "d:\\fwlog\\current";
my $archdir = "d:\\fwlog\\archive";
my $scriptdir = "d:\\fwlog\\scripts";
my $tm=localtime;
my ($day, $month, $year,$hour,$min,$sec) = ($tm->mday, $tm->mon+1, $tm->year+1900,$tm->hour,$
tm->min,$t
m->sec);
my $logfile=("$scriptdir\\fwe
xport$mont
h-$day-$ye
ar.log");
open (LOGF,">>$logfile");
##Assign the name file to a file handle for use.
open MFWLOG, "<$main_sfile" or die "Couldn't open input file: $!: ", scalar localtime,"\n";
##Pull the text from name file for use.
my $mpattern = <MFWLOG>;
close (MFWLOG);
##Format the text into desired pattern.
$mpattern =~ s/^.*\\//;
$mpattern = "$workdir\\$mpattern";
##Log export time.
print LOGF "$hour:$min:$sec--Starting
Export of $mpattern","\n";
##Use Checkpoint export tool to turn the binary log in the working directory (-i $mpattern)
##into a text file named fw-export.out and put it in the archive directory for pickup by the
##log server.
system ("c:\\winnt\\fw1\\ng\\bin\
\fwm logexport -d ; -i $mpattern -o $archdir\\$expfile -n");
##Clear the working directory after the export.
system ("del /Q $workdir\\*");
##Log the finish of the export.
my ($ehour,$emin,$esec) = ($tm->hour,$tm->min,$tm->s
ec);
print LOGF "$ehour:$emin:$esec--Done with Export","\n";
close (LOGF);
exit;
***************end script********************
***
Here is what ends up in the log file:
******************logfile*
**********
***
23:59:1--Starting Export of d:\fwlog\work\2004-04-05_2
35920_1.lo
g
23:59:1--Done with Export
******************logfile*
**********
***
I know the process is taking longer than that.
Ed