Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I ISPConfig 3
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 551
    • Issues 551
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #706

Closed
Open
Created Aug 08, 2009 by Andreas Schiffler@baboon68

Webalizer stats are missing since cron_daily.php script does not look for .gz compressed files

After noticing that webalizer stats for various subdomains were not complete (whole day ranges were missing), I noticed that the cron script does not pick up log files from "yesterday" since they had been already been gzip compressed.

Fix is easy ... check for uncompressed AND compressed logfiles in cron_daily.php using this updated code:

$sql = "SELECT domain_id, domain, document_root FROM web_domain WHERE server_id = ".$conf["server_id"]; $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)) { $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); $commandline = "$webalizer -c $webalizer_conf -n $domain -s $domain -r $domain -q -T -o $statsdir $logfile"; exec($commandline); }

Assignee
Assign to
Time tracking