Fixed: FS#1287 - ispconfig.log rotated twice
| | |
| | | //* Add Log-Rotation |
| | | if (is_dir('/etc/logrotate.d')) { |
| | | @unlink('/etc/logrotate.d/logispc3'); // ignore, if the file is not there |
| | | /* We rotate these logs in cron_daily.php |
| | | $fh = fopen('/etc/logrotate.d/logispc3', 'w'); |
| | | fwrite($fh, |
| | | "/var/log/ispconfig/ispconfig.log { \n" . |
| | |
| | | " delaycompress \n" . |
| | | "}"); |
| | | fclose($fh); |
| | | */ |
| | | } |
| | | } |
| | | |
| | |
| | | exec("cat /dev/null > $logfile"); |
| | | } |
| | | |
| | | // rotate the cron.log when it exceeds a size of 10 MB |
| | | $logfile = '/var/log/ispconfig/cron.log'; |
| | | if(is_file($logfile) && filesize($logfile) > 10000000) { |
| | | exec("gzip -c $logfile > $logfile.1.gz"); |
| | | exec("cat /dev/null > $logfile"); |
| | | } |
| | | |
| | | ####################################################################################################### |
| | | // Cleanup website tmp directories |
| | | ####################################################################################################### |