| | |
| | | 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); |
| | |
| | | } |
| | | 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'; |
| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | |
| | | ####################################################################################################### |
| | | //###################################################################################################### |
| | | // Cleanup logs in master database (only the "master-server") |
| | | ####################################################################################################### |
| | | //###################################################################################################### |
| | | |
| | | if ($app->dbmaster == $app->db) { |
| | | /** 7 days */ |
| | | |
| | | |
| | | $tstamp = time() - (60*60*24*7); |
| | | |
| | | /* |