tbrehm
2010-06-29 3e0034c1dc3eb944d4e275b62c314cf01dbeda96
server/cron_daily.php
@@ -207,6 +207,13 @@
      exec("gzip -c $logfile > $logfile.gz");
      unlink($logfile);
   }
   // rotate and compress the error.log when it exceeds a size of 10 MB
   $logfile = escapeshellcmd($rec["document_root"].'/log/error.log');
   if(is_file($logfile) && filesize($logfile) > 10000000) {
      exec("gzip -c $logfile > $logfile.1.gz");
      exec("cat /dev/null > $logfile");
   }
   // delete logfiles after 30 days
   $month_ago = date("Ymd",time() - 86400 * 30);
@@ -217,6 +224,17 @@
}
#######################################################################################################
// Rotate the ispconfig.log file
#######################################################################################################
// rotate the ispconfig.log when it exceeds a size of 10 MB
$logfile = '/var/log/ispconfig/ispconfig.log');
if(is_file($logfile) && filesize($logfile) > 10000000) {
   exec("gzip -c $logfile > $logfile.1.gz");
   exec("cat /dev/null > $logfile");
}
#######################################################################################################
// Cleanup website tmp directories
#######################################################################################################