Pico? That's just wrong....
Here's the relevant section:
Code:
sub pruneLogs {
my $rawRetention = `/opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogRawLifetime' | sed -e 's/zimbraLogRawLifetime: //'`;
chomp $rawRetention;
$rawRetention =~ s/d//;
print "RAW: $rawRetention\n";
my $summaryRetention = `/opt/zimbra/bin/zmprov gacf | egrep '^zimbraLogSummaryLifetime' | sed -e 's/zimbraLogSummaryLifetime: //'`;
chomp $summaryRetention;
$summaryRetention =~ s/d//;
print "SUM: $summaryRetention\n";
my $now = time();
my $rawBegin = tsToSqlTime($now - (60*60*24*$rawRetention),1);
my $summaryBegin = tsToSqlTime($now - (60*60*24*$summaryRetention),1);
my $sth;
print "Pruning raw mta logs from $rawBegin\n";
$sth = sqlExec ("delete from mta where arrive_time < '".$rawBegin."'");
print "Pruning raw amavis logs from $rawBegin\n";
$sth = sqlExec ("delete from amavis where arrive_time < '".$rawBegin."'");
print "Pruning raw disk logs from $rawBegin\n";
$sth = sqlExec ("delete from disk_status where time < '".$rawBegin."'");
print "Pruning summary mta logs from $summaryBegin\n";
$sth = sqlExec ("delete from mta_aggregate where period_start < '".$summaryBegin."'");
print "Pruning summary amavis logs from $summaryBegin\n";
$sth = sqlExec ("delete from amavis_aggregate where period_start < '".$summaryBegin."'");
print "Pruning summary disk logs from $summaryBegin\n";
$sth = sqlExec ("delete from disk_aggregate where period_start < '".$summaryBegin."'");
print "Pruning other raw logs from $rawBegin\n";
$sth = sqlExec ("delete from raw_logs where log_date < '".$rawBegin."'");
} AFAICT, it's failing on the sed line referring to zimbraLogSummaryLifetime. Does it show up as above (especially the "//" at the end?) Also, be aware that line ends with:
"//'`" - slash-slash-singlequote-backtick
One other thing you can try - change the sed calls to a full path (which sed) though I can't see why one would fail, and the other succeed.
If you can paste that function from your script into the forums (in CODE tags) that may help.