Hey all,
Okay, I'm still trying to get this log file script to work. The end
result should just be, if it's the 18th, the log file should be
090000FIMSOM090Aevent-20010717.log. However, I keep getting it to produce
the same day, instead of the previous. This script is set to run on an NT
server at 12:01am. I'm really pulling my hair out on this one.
#!/usr/bin/perl -w
# This script will move the CME log files and place the correct working
date
# on the logfile
# Changes: Rewrote the datefix subroutine and streamlined the localtime
statement
use strict;
use File::Copy;
# This section defines the different logfiles
my $event = "09000FIXSOM090Aevnt";
my $send = "09000FIXSOM090Asend";
my $recv = "09000FIXSOM090Arecv";
# This sets up the values for the $date variable
my($mday, $mon, $year) = (localtime)[3,4,5];
# This calls a subroutine that handles file moving at the end of the month
# so that the file for 20010630 doesn't become 20010700 for example
($mon,$mday) = &datefix($mon,$mday);
# This sets up the value of $date that we will use in the new name of the
# logfile
my $date = sprintf("%d%02d%02d", $year+1900, $mon, $mday);
# This shuts down the two services so we can move the log file
system("net stop NetProbe") or print "Couldn't stop NetProbe service
$!\n";
# This puts us in the right directory
chdir("d:/glsofts/slecmea/log");
# These lines move the respective log files to the old directory
move ("$event.log", "d:/glsofts/slecmea/log/old/$event-$date.log");
move ("$send.log", "d:/glsofts/slecmea/log/old/$send-$date.log");
move ("$recv.log", "d:/glsofts/slecmea/log/old/$recv-$date.log");
# Here we start the services back up again
system("net start NetProbe") or print "Couldn't start NetProbe service
$!\n";
# This is the subroutine that handles the last day of the month
sub datefix {
my ($month,$day) = @_;
if ($day == 1) {
my @days = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
$day = $days[$month - 1];
return ($month,$day);
} else {
my $adjust = $day - 1;
$month = $month+1;
$day = $adjust;
return ($month,$day);
}
}
Thanks,
Tom
--
#!/usr/bin/perl -w # 526-byte qrpff, Keith Winstein and Marc Horowitz
<[EMAIL PROTECTED]> # MPEG 2 PS VOB file on stdin -> descrambled output
on stdout # arguments: title key bytes in least to most-significant order
$_='while(read+STDIN,$_,2048){$a=29;$c=142;if((@a=unx"C*",$_)[20]&48){$h=5;
$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$d=
unxV,xb25,$_;$b=73;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=($t=255)&($d
>>12^$d>>4^$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9
,$_=(map{$_%16or$t^=$c^=($m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t
^=(72,@z=(64,72,$a^=12*($_%16-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271))
[$_]^(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]