加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 使用logrotate的无限日志

发布时间:2020-12-13 13:48:05 所属栏目:Linux 来源:网络整理
导读:在正常的logrotate.d配置文件中,有没有办法设置无限量的潜在日志? 我能想出的唯一一件事就是设置一些永远无法满足的疯狂数字.就像是: /var/log/app/* { missingok weekly copytruncate rotate 10000000000 compress notifempty olddir /var/log/app/old}
在正常的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.

所以我想你需要写一个庞大的数字来工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读