Identify log files in dir, not array for rotation
This commit is contained in:
parent
2df752bfb1
commit
d00415d13f
|
@ -72,12 +72,12 @@ function log_rotate() {
|
||||||
global $logdir;
|
global $logdir;
|
||||||
$rotate = filemtime($logdir.'/rotate');
|
$rotate = filemtime($logdir.'/rotate');
|
||||||
if((time() - $rotate) > 86400) {
|
if((time() - $rotate) > 86400) {
|
||||||
$log_files = array('nntp.log', 'spoolnews.log', 'nocem.log', 'newsportal.log', 'expire.log', 'access.log');
|
$log_files=scandir($logdir);
|
||||||
foreach($log_files as $logfile) {
|
foreach($log_files as $logfile) {
|
||||||
$logfile=$logdir.'/'.$logfile;
|
if(substr($logfile, -4) != '.log' ) {
|
||||||
if(!is_file($logfile)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$logfile=$logdir.'/'.$logfile;
|
||||||
@unlink($logfile.'.5');
|
@unlink($logfile.'.5');
|
||||||
@rename($logfile.'.4', $logfile.'.5');
|
@rename($logfile.'.4', $logfile.'.5');
|
||||||
@rename($logfile.'.3', $logfile.'.4');
|
@rename($logfile.'.3', $logfile.'.4');
|
||||||
|
|
Loading…
Reference in New Issue