Log file rotation fails, no error.

My log files seem to never rotate (at least I only checked the apache access_logs), so I tried to do a forced log rotation, this was the output:

Forcing the immediate rotation of all log files ..

 .. failed! See the output above for the reason why.

No error is specified…

I also checked the directory and the file size of the log files is still the same, so the command did indeed not execute as it should have. (100MB+ access_log).

Any ideas as to what may be the cause?

Actually the first time I did get “done”. However, as said in the previous post, the size of the access_log is still the same. settings for minimum and maximum log size are set to default. Do I need to change this?

I’m unsure what to fill in, why is there a maximum option anyway?

Howdy,

What happens if you run this command as root:

logrotate -d -f /etc/logrotate.conf

Do you see any errors?

-Eric

It seems to ignore the domain.conf files because of bad file mode. Any idea what that means?

[root@host]# logrotate -d -f /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file clamav-update
reading config file httpd
reading config file mailman
reading config file mariadb
reading config file named
reading config file ppp
reading config file proftpd
reading config file sa-update
reading config file syslog
reading config file wpa_supplicant
Ignoring domain.com conf because of bad file mode.
reading config file yum

OK, I set the chmod to 644 for those config files (though i didn’t create them, so seems to be a webmin bug).

Then did another forced log rotate; now the config files are included, but the result is still the same; logs are not rotated and no new ones / renmaes either as in this output…

rotating pattern: /var/log/virtualmin/domain_1_access_log /var/log/virtualmin/domain_1_error_log  forced from command line (5 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/virtualmin/domain_1_access_log    
  log needs rotating
considering log /var/log/virtualmin/domain_1_error_log
  log needs rotating
rotating log /var/log/virtualmin/domain_1_access_log, log->rotateCount is 5
dateext suffix '-20150624'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/virtualmin/domain_1_error_log, log->rotateCount is 5
dateext suffix '-20150624'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/virtualmin/domain_1_access_log to /var/log/virtualmin/domain_1_access_log-20150624
creating new /var/log/virtualmin/domain_1_access_log mode = 0660 uid = 502 gid = 48
renaming /var/log/virtualmin/domain_1_error_log to /var/log/virtualmin/domain_1_error_log-20150624
creating new /var/log/virtualmin/domain_1_error_log mode = 0660 uid = 502 gid = 48
running postrotate script
running script with arg /var/log/virtualmin/domain_1_access_log     /var/log/virtualmin/domain_1_error_log : "
	service httpd reload ; sleep 5
"
compressing log with: /bin/gzip
compressing log with: /bin/gzip

I have the same problem – but I’m not seeing an error when I run

logrotate -d -f /etc/logrotate.conf

Any ideas? The output is below … any help appreciated.

Thanks!

Neil

root@www:~# logrotate -d -f /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file apache2
reading config file apport
reading config file apt
reading config file clamav-daemon
reading config file clamav-freshclam
reading config file dpkg
reading config file fail2ban
Ignoring httpd-prerotate because it's not a regular file.
reading config file lxd
reading config file mactech.com.conf
reading config file mysql-server
reading config file php7.0-fpm
reading config file proftpd-basic
reading config file rsyslog
reading config file unattended-upgrades

Handling 21 logs

rotating pattern: /var/log/apache2/*.log  forced from command line (14 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/apache2/access.log
  log does not need rotating
considering log /var/log/apache2/error.log
  log needs rotating
considering log /var/log/apache2/other_vhosts_access.log
  log needs rotating
considering log /var/log/apache2/suexec.log
  log needs rotating
rotating log /var/log/apache2/error.log, log->rotateCount is 14
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/apache2/error.log-20200322 already exists, skipping rotation
rotating log /var/log/apache2/other_vhosts_access.log, log->rotateCount is 14
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/apache2/other_vhosts_access.log-20200322 already exists, skipping rotation
rotating log /var/log/apache2/suexec.log, log->rotateCount is 14
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/apache2/suexec.log-20200322 already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/apport.log  forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/apport.log
  log does not need rotating
switching euid to 0 and egid to 0

rotating pattern: /var/log/apt/term.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/apt/term.log
  log does not need rotating
switching euid to 0 and egid to 0

rotating pattern: /var/log/apt/history.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/apt/history.log
  log does not need rotating
switching euid to 0 and egid to 0

rotating pattern: /var/log/clamav/clamav.log  forced from command line (12 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/clamav/clamav.log
  log needs rotating
rotating log /var/log/clamav/clamav.log, log->rotateCount is 12
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/clamav/clamav.log-20200322 already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/clamav/freshclam.log  forced from command line (12 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/clamav/freshclam.log
  log needs rotating
rotating log /var/log/clamav/freshclam.log, log->rotateCount is 12
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/clamav/freshclam.log-20200322 already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/dpkg.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/dpkg.log
  log does not need rotating
switching euid to 0 and egid to 0

rotating pattern: /var/log/alternatives.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/alternatives.log
  log does not need rotating
switching euid to 0 and egid to 0

rotating pattern: /var/log/fail2ban.log  forced from command line (4 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/fail2ban.log
  log needs rotating
rotating log /var/log/fail2ban.log, log->rotateCount is 4
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/fail2ban.log-20200322 already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/lxd/lxd.log  forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/lxd/lxd.log
  log /var/log/lxd/lxd.log does not exist -- skipping
switching euid to 0 and egid to 0

rotating pattern: /var/log/virtualmin/mactech.com_access_log /var/log/virtualmin/mactech.com_error_log  forced from command line (5 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/virtualmin/mactech.com_access_log
  log needs rotating
considering log /var/log/virtualmin/mactech.com_error_log
  log needs rotating
rotating log /var/log/virtualmin/mactech.com_access_log, log->rotateCount is 5
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/virtualmin/mactech.com_access_log-20200322.gz already exists, skipping rotation
rotating log /var/log/virtualmin/mactech.com_error_log, log->rotateCount is 5
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/virtualmin/mactech.com_error_log-20200322.gz already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/mysql.log /var/log/mysql/*log  forced from command line (7 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/mysql.log
  log /var/log/mysql.log does not exist -- skipping
considering log /var/log/mysql/error.log
  log needs rotating
rotating log /var/log/mysql/error.log, log->rotateCount is 7
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/mysql/error.log-20200322.gz already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/php7.0-fpm.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/php7.0-fpm.log
  log needs rotating
rotating log /var/log/php7.0-fpm.log, log->rotateCount is 12
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/php7.0-fpm.log-20200322 already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/proftpd/proftpd.log 
/var/log/proftpd/controls.log 
 forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/proftpd/proftpd.log
  log needs rotating
considering log /var/log/proftpd/controls.log
  log does not need rotating
rotating log /var/log/proftpd/proftpd.log, log->rotateCount is 7
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/proftpd/proftpd.log-20200322 already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/proftpd/xferlog
/var/log/proftpd/xferreport
 forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/proftpd/xferlog
  log /var/log/proftpd/xferlog does not exist -- skipping
considering log /var/log/proftpd/xferreport
  log /var/log/proftpd/xferreport does not exist -- skipping
not running prerotate script, since no logs will be rotated
not running postrotate script, since no logs were rotated
switching euid to 0 and egid to 0

rotating pattern: /var/log/syslog
 forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/syslog
  log needs rotating
rotating log /var/log/syslog, log->rotateCount is 7
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/syslog-20200322 already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
 forced from command line (4 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/mail.info
  log /var/log/mail.info does not exist -- skipping
considering log /var/log/mail.warn
  log does not need rotating
considering log /var/log/mail.err
  log does not need rotating
considering log /var/log/mail.log
  log needs rotating
considering log /var/log/daemon.log
  log /var/log/daemon.log does not exist -- skipping
considering log /var/log/kern.log
  log does not need rotating
considering log /var/log/auth.log
  log needs rotating
considering log /var/log/user.log
  log /var/log/user.log does not exist -- skipping
considering log /var/log/lpr.log
  log /var/log/lpr.log does not exist -- skipping
considering log /var/log/cron.log
  log /var/log/cron.log does not exist -- skipping
considering log /var/log/debug
  log /var/log/debug does not exist -- skipping
considering log /var/log/messages
  log /var/log/messages does not exist -- skipping
rotating log /var/log/mail.log, log->rotateCount is 4
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/mail.log-20200322 already exists, skipping rotation
rotating log /var/log/auth.log, log->rotateCount is 4
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding logs to compress failed
destination /var/log/auth.log-20200322 already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/unattended-upgrades/unattended-upgrades.log 
/var/log/unattended-upgrades/unattended-upgrades-dpkg.log
/var/log/unattended-upgrades/unattended-upgrades-shutdown.log
 forced from command line (6 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/unattended-upgrades/unattended-upgrades.log
  log /var/log/unattended-upgrades/unattended-upgrades.log does not exist -- skipping
considering log /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
  log /var/log/unattended-upgrades/unattended-upgrades-dpkg.log does not exist -- skipping
considering log /var/log/unattended-upgrades/unattended-upgrades-shutdown.log
  log does not need rotating
switching euid to 0 and egid to 0

rotating pattern: /var/log/wtmp  forced from command line (1 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/wtmp
  log needs rotating
rotating log /var/log/wtmp, log->rotateCount is 1
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/wtmp-20200322.gz already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/btmp  forced from command line (1 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/btmp
  log needs rotating
rotating log /var/log/btmp, log->rotateCount is 1
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/btmp-20200322.gz already exists, skipping rotation
switching euid to 0 and egid to 0

rotating pattern: /var/log/procmail.log  forced from command line (5 rotations)
empty log files are rotated, old logs are removed
switching euid to 0 and egid to 108
considering log /var/log/procmail.log
  log needs rotating
rotating log /var/log/procmail.log, log->rotateCount is 5
dateext suffix '-20200322'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/procmail.log-20200322.gz already exists, skipping rotation
switching euid to 0 and egid to 0