在正常的logrotate.d配置文件中,有没有办法设置无限量的潜在日志?
我能想出的唯一一件事就是设置一些永远无法满足的疯狂数字.就像是:
/var/log/app/* {
missingok
weekly
copytruncate
rotate 10000000000
compress
notifempty
olddir /var/log/app/old
}
但这对我来说似乎很不好看.
最佳答案
从UNIX logrotate man page开始:
rotate count
Log files are rotated times before being removed or mailed to the
address specified in a mail directive. If count is 0,old versions are
removed rather then rotated.
所以我想你需要写一个庞大的数字来工作.