hi there
i hope anyone can tell me what's wrong:
this is the part crontab daoesn't work properly:
...
#every day at seven start cache_it.pl
0 7 * * * /usr/bin/perl /statistik/mlogs/micha/bin/cache_it.pl
this is the skript(when started at command line with: "perl cache_it.pl" it works great):
the problem is that when started by crontab the job get's killed without any messages or errors. cron is telling me nothing in its message-files nor sending any emails. i don't know why. what am i doing wrong?
thanks for any help
michael
i hope anyone can tell me what's wrong:
this is the part crontab daoesn't work properly:
...
#every day at seven start cache_it.pl
0 7 * * * /usr/bin/perl /statistik/mlogs/micha/bin/cache_it.pl
this is the skript(when started at command line with: "perl cache_it.pl" it works great):
Code:
$DATE;
$month_dez=(localtime)[4]+1;
$Day=(localtime)[3];
$Year=(localtime)[5];
$longYear=(localtime)[5]+1900;
$Year=substr($Year,1);
if($month_dez<10)
{$month_dez="0".$month_dez;}
if($Day<10)
{$Day="0".$Day;}
$DATE=$Year.$month_dez.$Day;
opendir(test, $outputdir)||mkdir("/statistik/mlogs/micha/stat"."$DATE");
closedir(test);
$cachecfgdir="/statistik/mlogs/micha/cachecfg/$DATE"."/";
print $cachecfgdir."\n";
mkdir("/statistik/mlogs/micha/cachefiles/$DATE");
system("gunzip /statistik/mlogs/micha/logs/access_log-$DATE"."0000.gz");
opendir(cachecfgdir, $cachecfgdir) or die "couldn't open /statistik/mlogs/micha/cachecfg/$DATE"."/";
while (defined($file = readdir(cachecfgdir))) {
print "im while...\n";
if($file=~/cfg/){
print $file;
$login=substr($file,0,7);
print " - ".$login."\n";
$analogcall="/statistik/analog-6.0_ink/analog_6_ink +g"."$cachecfgdir"."$file /statistik/mlogs/micha/logs/access_log-$DATE"."0000 +O/statistik/mlogs/micha/stat$DATE"."/"."$login.html";
print "ANALOG CALLED WITH:\n".$analogcall."\n\n";
system("/statistik/analog-6.0_ink/analog_6_ink +g"."$cachecfgdir"."$file /statistik/mlogs/micha/logs/access_log-$DATE"."0000 +O/statistik/mlogs/micha/stat$DATE/"."$login.html");
print "\n***************************************\n";
}
}
closedir(cachecfgdir);
system("gzip /statistik/mlogs/micha/logs/access_log-$DATE"."0000");
the problem is that when started by crontab the job get's killed without any messages or errors. cron is telling me nothing in its message-files nor sending any emails. i don't know why. what am i doing wrong?
thanks for any help
michael