【发布时间】:2018-09-06 03:24:04
【问题描述】:
这是 /etc/logrotate.d/mylog 下的 logrotate 配置文件
/var/www/www.mysite.com/logs/* {
daily
rotate 365
compress
delaycompress
missingok
notifempty
create 0664 apache apache
}
我昨天下午 4 点设置的,今天上午 10 点我没有看到任何压缩文件。
我尝试使用 -d 和 -f 选项进行 logrotate
使用 -d 选项,我得到了这个输出
reading config file mysite
reading config info for /var/www/www.mysite.com/logs/*
Handling 1 logs
rotating pattern: /var/www/www.mysite.com/logs/* after 1 days (365 rotations)
empty log files are not rotated, old logs are removed
considering log/var/www/www.mysite.com/logs/access-2018-08-08.log
log does not need rotating
使用 -f 选项,什么也没有出现。
但我注意到它在我的每个日志中添加了 .1 后缀。
请任何人解释一下这是什么奇怪的行为?
【问题讨论】:
-
Stack Overflow 是一个编程和开发问题的网站。这个问题似乎离题了,因为它与编程或开发无关。请参阅帮助中心的What topics can I ask about here。也许Super User 或Unix & Linux Stack Exchange 会是一个更好的提问地点。
-
感谢@jww 提供该链接。