Marius Cramer
2013-11-14 b1a6a5a3991cec5cd08873b01376e45d0b247f18
server/lib/classes/cron.d/200-logfiles.inc.php
@@ -50,15 +50,15 @@
    public function onRunJob() {
        global $app, $conf;
        
        #######################################################################################################
      //######################################################################################################
        // Make the web logfiles directories world readable to enable ftp access
        #######################################################################################################
      //######################################################################################################
        if(is_dir('/var/log/ispconfig/httpd')) exec('chmod +r /var/log/ispconfig/httpd/*');
        #######################################################################################################
      //######################################################################################################
        // Manage and compress web logfiles and create traffic statistics
        #######################################################################################################
      //######################################################################################################
        $sql = "SELECT domain_id, domain, type, document_root, web_folder, parent_domain_id FROM web_domain WHERE (type = 'vhost' or type = 'vhostsubdomain') AND server_id = ".$conf['server_id'];
        $records = $app->db->queryAllRecords($sql);
@@ -144,9 +144,9 @@
        }
        unset($tmp_hostname);
        #######################################################################################################
      //######################################################################################################
        // Rotate the ispconfig.log file
        #######################################################################################################
      //######################################################################################################
        // rotate the ispconfig.log when it exceeds a size of 10 MB
        $logfile = $conf['ispconfig_log_dir'].'/ispconfig.log';
@@ -169,9 +169,9 @@
            exec("cat /dev/null > $logfile");
        }
        #######################################################################################################
      //######################################################################################################
        // Cleanup website tmp directories
        #######################################################################################################
      //######################################################################################################
        $sql = "SELECT domain_id, domain, document_root, system_user FROM web_domain WHERE server_id = ".$conf['server_id'];
        $records = $app->db->queryAllRecords($sql);
@@ -185,12 +185,14 @@
            }
        }
        #######################################################################################################
      //######################################################################################################
        // Cleanup logs in master database (only the "master-server")
        #######################################################################################################
      //######################################################################################################
        if ($app->dbmaster == $app->db) {
            /** 7 days */
            $tstamp = time() - (60*60*24*7);
            /*