Forum

logrotate

Evan P.
21 March 2017, 19:28
My /etc/logrotate.d/hiawatha follows:
/var/log/hiawatha/access.log {
weekly
compress
delaycompress
rotate 52
missingok
create 640 www-data www-data
sharedscripts
/usr/bin/killall -HUP hiawatha
}

When I execute

/usr/sbin/logrotate /etc/logrotate.conf

it I receive:

error: hiawatha:9 unexpected log filename
error: found error in /var/log/hiawatha/access.log , skipping

The log file appears to be good:
/var/log/hiawatha# ls -l access.log
-rw-r----- 1 www-data www-data 10931503 Mar 21 14:04 access.log

Why am I getting this error that prevents the rotation of the logs?
Joe Schmoe
23 March 2017, 03:55
I am using Debian and was having the same problem. I don't think some of those options work anymore. Here is my config, which can be adjusted for your needs.
/var/log/hiawatha/*.log {
rotate 52
weekly
compress
copytruncate
missingok
notifempty
}

Hope that helps!
Evan P.
28 March 2017, 15:22
It help and it works now. Thanks!
This topic has been closed.