配置logrotate状态文件

Configure logrotate status file

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

您尝试过使用“-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.