tbrehm
2010-09-16 cafdec2a465ab57626a32efb065c6d054f71d8eb
Fixed: FS#1287 - ispconfig.log rotated twice
2 files modified
9 ■■■■■ changed files
install/lib/installer_base.lib.php 2 ●●●●● patch | view | raw | blame | history
server/cron_daily.php 7 ●●●●● patch | view | raw | blame | history
install/lib/installer_base.lib.php
@@ -1470,6 +1470,7 @@
        //* 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" .
@@ -1487,6 +1488,7 @@
                    "    delaycompress \n" .
                    "}");
            fclose($fh);
            */
        }
    }
server/cron_daily.php
@@ -234,6 +234,13 @@
    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
#######################################################################################################