我有一堆我管理的 Ubuntu 14.04 服务器,其中 logrotate 没有在/var/log/*. 我将假设它存在问题,/etc/logrotate.d/rsyslog因为我看到/etc/logrotate.d/正确旋转日志中的其他条目。
这些服务器是使用 CHEF 部署的。但是,我在食谱等中没有看到任何引用 logrotate 的功能更改的内容。添加了一些脚本/etc/logrotate.d,这些脚本每天都按预期运行。一个脚本是否有可能/etc/logrotate.d影响另一个脚本(我不这么认为)?在 Ubuntu 12.04 机器上配置了使用相同 CHEF 配方的类似服务器没有日志在/var/log/*.
运行/usr/sbin/logrotate -d /etc/logrotate.conf,我得到以下信息(省略与 rsyslog 无关的任何内容):
rotating pattern: /var/log/syslog
after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
switching euid to 0 and egid to 104
considering log /var/log/syslog
log does not need rotating
switching euid to 0 and egid to 0
rotating pattern: …Run Code Online (Sandbox Code Playgroud)