【问题标题】:Configure logrotate status file配置 logrotate 状态文件
【发布时间】:2015-02-05 19:48:49
【问题描述】:

我正在尝试使用 logrotate 来轮换我的日志文件。但是,我们不想以 root 身份执行此操作。但是,如果我使用其他作业帐户执行它,它会失败,因为它无法编辑或创建文件 /var/lib/logrotate.status。有没有办法配置日志轮换以使用不同的状态文件。

【问题讨论】:

    标签: linux redhat logrotate


    【解决方案1】:

    你试过使用“-s”参数吗?来自手册:

       -s, --state <statefile>
              Tells logrotate to use an alternate state file.  This is  useful
              if  logrotate  is being run as a different user for various sets
              of log files.  The default state file is /var/lib/logrotate/sta-
              tus.
    

    【讨论】:

      猜你喜欢
      • 2012-04-14
      • 2023-04-09
      • 2011-07-26
      • 2015-07-24
      • 2014-12-16
      • 2020-07-27
      • 1970-01-01
      • 2020-10-26
      • 2019-04-22
      相关资源
      最近更新 更多