I have a script that will read a log. The first three characters of the log are a code for that customer (i.e. xxx). The program starts and runs then stops with this error. The out.txt is located in the log directory for all customers up to a certain one. This one has the same permissions as all the others. The program stops, and nothing past that customer gets the file.
$adminDir = "/data1/Scripts";
$scriptDir = "/data1/Scripts";
chomp($toDay = `date +%m-%d-%y`);
@prodDirs = ();
open(DIRS, "$scriptDir/production_dirs") or warn "Can't open $scriptDir/production_dirs file: $!\n";
$count = 0;
while (<DIRS>) {
if(index($_, '#') < 0) {
chomp($prodDirs[$count++] = $_);
}
}
close(DIRS);
foreach $jobDir (@prodDirs) {
@dirFields = split(/\|/, $jobDir);
$srcDir = $dirFields[0];
$workDir = "$srcDir";
$logFile = $workDir . "/log/" . $dirFields[11] . "log";
$oldLog = $logFile;
$oldLogBack = $oldLog . "." . $toDay;
$newLog = $workDir . "/log/" . "out.txt";
open(FILE, "<$logFile")|| die "Can't open input file $!";
open(OUT, ">$newLog") || die "Can't open output file $!";
while(<FILE>) {
print OUT if($_=~/(.*)(Jan 1)(.*?)/gs);
}
}