From d00415d13f09ec07d5a01ffe5fa06db1052f38de Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Mon, 24 May 2021 02:18:03 -0700 Subject: [PATCH] Identify log files in dir, not array for rotation --- Rocksolid_Light/rslight/scripts/cron.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Rocksolid_Light/rslight/scripts/cron.php b/Rocksolid_Light/rslight/scripts/cron.php index 2e98c4b..7c57597 100755 --- a/Rocksolid_Light/rslight/scripts/cron.php +++ b/Rocksolid_Light/rslight/scripts/cron.php @@ -72,12 +72,12 @@ function log_rotate() { global $logdir; $rotate = filemtime($logdir.'/rotate'); 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) { - $logfile=$logdir.'/'.$logfile; - if(!is_file($logfile)) { + if(substr($logfile, -4) != '.log' ) { continue; } + $logfile=$logdir.'/'.$logfile; @unlink($logfile.'.5'); @rename($logfile.'.4', $logfile.'.5'); @rename($logfile.'.3', $logfile.'.4');