我有一个 'apache' 用户的日志文件所有者,我想用 logrotate 进行轮换。
我想通过以不同的用户身份运行 logrotate 来做到这一点,使用 copytruncate 策略说“web”。
失败并出现此错误:
error: error setting owner of ./logfile.log.1: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
但仅仅是因为 logrotate 试图将新文件的所有者更改为旋转文件的所有者,即 apache。但我不关心具有相同所有者的新文件,如果 logrotate 会创建以“web”为所有者的副本,那会很好,然后它可以正常工作。
那么有没有办法阻止 logrotate 更改复制文件的所有者?
logrotate ×1