Here is my logs directory:
root@my-server:/var/www/vhosts/my-website/logs# ll
total 1468016
-rw-r--r-- 1 my-website webuser 95719295 Mar 19 18:04 my-website-access.log
-rw-r--r-- 1 my-website webuser 21130452 Apr 27 2019 my-website-access.log.4.gz
-rw-r--r-- 1 my-website webuser 831892 Mar 17 15:39 my-website-error.log
-rw-r--r-- 1 root root 1238469639 Mar 19 18:04 my-website-ssl-access.log
-rw-r--r-- 1 root root 20 Mar 19 17:55 my-website-ssl-access.log.3.gz
-rw-r--r-- 1 root root 16976113 Mar 2 2019 my-website-ssl-access.log.9.gz
-rw-r--r-- 1 root root 102746845 Mar 19 18:04 my-website-ssl-error.log
-rw-r--r-- 1 my-website webuser 21089307 Mar 19 18:03 test.my-website-access.log
-rw-r--r-- 1 my-website webuser 6243491 Mar 17 18:48 test.my-website-error.log
Note the massive > 1GB file sitting there. Here is my logrotate config file:
/var/www/vhosts/*/logs/*.log {
rotate 8
daily
size 256M
compress
delaycompress
sharedscripts
postrotate
/bin/systemctl reload apache2 > /dev/null
endscript
}
When I run the command:
logrotate -vv -f /etc/logrotate.d/vhost
it appears to be working, I get these messages (amongst a lot of other noise):
considering log /var/www/vhosts/my-website/logs/my-website-ssl-access.log
log needs rotating
...
rotating log /var/www/vhosts/my-website/logs/my-website-ssl-access.log, log->rotateCount is 8
dateext suffix '-20200319'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
previous log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.1 does not exist
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.8.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.9.gz (rotatecount 8, logstart 1, i 8),
old log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.8.gz does not exist
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.7.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.8.gz (rotatecount 8, logstart 1, i 7),
old log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.7.gz does not exist
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.6.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.7.gz (rotatecount 8, logstart 1, i 6),
old log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.6.gz does not exist
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.5.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.6.gz (rotatecount 8, logstart 1, i 5),
old log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.5.gz does not exist
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.4.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.5.gz (rotatecount 8, logstart 1, i 4),
old log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.4.gz does not exist
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.3.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.4.gz (rotatecount 8, logstart 1, i 3),
old log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.3.gz does not exist
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.2.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.3.gz (rotatecount 8, logstart 1, i 2),
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.1.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.2.gz (rotatecount 8, logstart 1, i 1),
old log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.1.gz does not exist
renaming /var/www/vhosts/my-website/logs/my-website-ssl-access.log.0.gz to /var/www/vhosts/my-website/logs/my-website-ssl-access.log.1.gz (rotatecount 8, logstart 1, i 0),
old log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.0.gz does not exist
log /var/www/vhosts/my-website/logs/my-website-ssl-access.log.9.gz doesn't exist -- won't try to dispose of it
rotating log /var/www/vhosts/my-website/logs/my-website-ssl-error.log, log->rotateCount is 8
dateext suffix '-20200319'
...but the large log file does not appear to be being rotated despite logrotate apparently saying it has:
-rw-r--r-- 1 root root 1238469639 Mar 19 18:04 my-website-ssl-access.log
Any idea what this would be happening?
0 Answers