grazinggoat
Programmer
When i execute the script I get the following error:
./run.pl
sh: ls -l /tmp/var/a.log: No such file or directory
sh: ls -l /tmp/var/b.log: No such file or directory
sh: ls -l /tmp/var/c.log: No such file or directory
Seems its bombing on the qx but why wouldn't it find
the filenames they are there? Any thought. Thnx Gents!
$aLog = "/tmp/var/a.log";
$bLog = "/tmp/var/b.log";
$cLog = "/tmp/var/c.log";
my @files = ( $aLog, $bLog, $cLog );
foreach $f (@files) {
chomp($f);
$LogSize = qx("ls -l $f");
( $LS_FSIZE ) = (split)[4];
if ( $LS_FSIZE > 5000000 ) {
system("/bin/gzip -9 $f");
system("/bin/mv $f.gz /logs/$f.gz");
print "log moved..\n";
}
} # End foreach Loop
exit 0;
./run.pl
sh: ls -l /tmp/var/a.log: No such file or directory
sh: ls -l /tmp/var/b.log: No such file or directory
sh: ls -l /tmp/var/c.log: No such file or directory
Seems its bombing on the qx but why wouldn't it find
the filenames they are there? Any thought. Thnx Gents!
$aLog = "/tmp/var/a.log";
$bLog = "/tmp/var/b.log";
$cLog = "/tmp/var/c.log";
my @files = ( $aLog, $bLog, $cLog );
foreach $f (@files) {
chomp($f);
$LogSize = qx("ls -l $f");
( $LS_FSIZE ) = (split)[4];
if ( $LS_FSIZE > 5000000 ) {
system("/bin/gzip -9 $f");
system("/bin/mv $f.gz /logs/$f.gz");
print "log moved..\n";
}
} # End foreach Loop
exit 0;