Skip to content

Commit 8c034eb

Browse files
committed
Fixed: FS#839 - Webalizer stats are missing since cron_daily.php script does not look for .gz compressed files.
1 parent 616d349 commit 8c034eb

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

server/cron_daily.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,18 @@
9393
foreach($records as $rec) {
9494
$yesterday = date("Ymd",time() - 86400);
9595
$logfile = escapeshellcmd($rec["document_root"].'/log/'.$yesterday.'-access.log');
96-
if(@is_file($logfile)) {
97-
$domain = escapeshellcmd($rec["domain"]);
98-
$statsdir = escapeshellcmd($rec["document_root"].'/web/stats');
99-
$webalizer = '/usr/bin/webalizer';
100-
$webalizer_conf = '/etc/webalizer/webalizer.conf';
101-
if(!@is_dir($statsdir)) mkdir($statsdir);
102-
exec("$webalizer -c $webalizer_conf -n $domain -s $domain -r $domain -q -T -o $statsdir $logfile");
96+
if(!@is_file($logfile)) {
97+
$logfile = escapeshellcmd($rec["document_root"].'/log/'.$yesterday.'-access.log.gz');
98+
if(!@is_file($logfile)) {
99+
continue;
100+
}
103101
}
102+
$domain = escapeshellcmd($rec["domain"]);
103+
$statsdir = escapeshellcmd($rec["document_root"].'/web/stats');
104+
$webalizer = '/usr/bin/webalizer';
105+
$webalizer_conf = '/etc/webalizer/webalizer.conf';
106+
if(!@is_dir($statsdir)) mkdir($statsdir);
107+
exec("$webalizer -c $webalizer_conf -n $domain -s $domain -r $domain -q -T -p -o $statsdir $logfile");
104108
}
105109

106110
#######################################################################################################

0 commit comments

Comments
 (0)