I have the following new logrotate configuration:
/var/log/nexus/nexus.log {
rotate 7
missingok
compress
delaycompress
copytruncate
daily
}
When I run logrotate -d nexus
, I get the following:
reading config file nexus
reading config info for /var/log/nexus/nexus.log
Handling 1 logs
rotating pattern: /var/log/nexus/nexus.log after 1 days (7 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/nexus/nexus.log
log does not need rotating
My /var/log/nexus/ folder contains the following:
nexus.log
oldlogs.tar.gz
Why isn't LogRotate rotating the nexus.log file? What I was expecting was that the nexus.log file would have been truncated and a new file, something like nexus.log-201106241000, would have been created.