我有以下新的logrotate配置:
/var/log/nexus/nexus.log {
rotate 7
missingok
compress
delaycompress
copytruncate
daily
}
运行时logrotate -d nexus
,我得到以下信息:
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
我的/ var / log / nexus /文件夹包含以下内容:
nexus.log
oldlogs.tar.gz
为什么LogRotate不旋转nexus.log文件?我所期望的是nexus.log文件将被截断,并且将创建一个新文件,例如nexus.log-201106241000。