Commit 8c034eb9 authored by tbrehm's avatar tbrehm

Fixed: FS#839 - Webalizer stats are missing since cron_daily.php script does...

Fixed: FS#839 - Webalizer stats are missing since cron_daily.php script does not look for .gz compressed files.
parent 616d3490
......@@ -93,14 +93,18 @@ $records = $app->db->queryAllRecords($sql);
foreach($records as $rec) {
$yesterday = date("Ymd",time() - 86400);
$logfile = escapeshellcmd($rec["document_root"].'/log/'.$yesterday.'-access.log');
if(@is_file($logfile)) {
if(!@is_file($logfile)) {
$logfile = escapeshellcmd($rec["document_root"].'/log/'.$yesterday.'-access.log.gz');
if(!@is_file($logfile)) {
continue;
}
}
$domain = escapeshellcmd($rec["domain"]);
$statsdir = escapeshellcmd($rec["document_root"].'/web/stats');
$webalizer = '/usr/bin/webalizer';
$webalizer_conf = '/etc/webalizer/webalizer.conf';
if(!@is_dir($statsdir)) mkdir($statsdir);
exec("$webalizer -c $webalizer_conf -n $domain -s $domain -r $domain -q -T -o $statsdir $logfile");
}
exec("$webalizer -c $webalizer_conf -n $domain -s $domain -r $domain -q -T -p -o $statsdir $logfile");
}
#######################################################################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment