Forum

logrotate not rotating on debian - stumped...

Lido
31 October 2018, 08:30
I've read lots of thread here about logrotate and have tried quite a few different of the suggestions and I can't get the access log to rotate. The /var/log/hiawatha files are rotating fine, and permissions are the same as those, but they don't get touched for some reason. I can't find any errors in syslog or messages about it.

$ l /var/log/hiawatha/
total 3384
-rw-r----- 1 www-data www-data 442604 Oct 31 06:03 access.log
-rw-r----- 1 www-data www-data 478300 Oct 28 06:12 access.log.1
-rw-r----- 1 www-data www-data 8295 Aug 26 05:24 access.log.10.gz
-rw-r----- 1 www-data www-data 12156 Aug 21 06:14 access.log.11.gz


$ l /var/www/my_site/log/
total 316216
-rw-r----- 1 www-data www-data 309498755 Oct 31 07:26 access.log
-rw-r----- 1 www-data www-data 14218318 Oct 31 05:00 error.log

$ more /etc/logrotate.d/hiawatha 
/var/log/hiawatha/access.log {
weekly
compress
delaycompress
rotate 52
missingok
create 640 www-data www-data
sharedscripts
postrotate
/usr/bin/killall -HUP hiawatha
endscript
}

/var/www/my_site/log/*.log {
weekly
compress
delaycompress
rotate 52
missingok
create 640 www-data www-data
sharedscripts
postrotate
/usr/bin/killall -HUP hiawatha
endscript
}
Hugo Leisink
31 October 2018, 10:43
I don't know. This ain't no Hiawatha issue, but a logrotate issue. Is *.log allowed in the logrotate config? Is Hiawatha's logrotate functionality an option for you?
Lido
31 October 2018, 19:54
The result is the same with or without the wildcard. I'll post on linuxquestions or something and see if anyone has any suggestions. If that fails, I'll check into the Hiawatha log rotate feature.
Lido
2 November 2018, 18:35
For anyone else who has this issue, I ran the following:
sudo /usr/sbin/logrotate -vf /etc/logrotate.conf

...and the log files did rotate. Here's a post about it on Server Fault:

https://serverfault.com/questions/938098/why-isnt-logrotate-working-on-particular-log-files-permissions-and-config-the
This topic has been closed.