我在我的/etc/logrotate.conf文件中有以下几行,我不太清楚他们在做什么:
(编辑显示完整文件)
# see "man logrotate" for details # rotate log files weekly weekly # keep 52 weeks worth of backlogs rotate 52 # <-- added it by me # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress # RPM packages drop log rotation information into this directory include /etc/logrotate.d # no packages own wtmp -- we'll rotate them here /var/log/wtmp { monthly minsize 1M create 0664 root utmp rotate 1 } # system-specific logs may be also be configured here.
你可能想参考logrotate手册页,
/var/log/wtmp – 要处理的文件 monthly – 在monthly首次运行logrotate时处理文件。 minsize 1M – 文件在处理之前必须大于minsize个字节 create ... – 将使用这些权限和所有者/组创build新的日志文件 rotate 1 – 文件将只被旋转一次,只保留一个早期版本的文件。 把它放在一起
logrotate每月首次运行,请检查/ var / log / wtmp文件的大小,如果大于1M字节,请将其旋转。 如果该文件的早期版本存在,请删除较早的版本。 创build一个新的/ var / log / wtmp文件,拥有权限为0644的utmp组的根。
编辑:
wtmp文件存储系统的login和注销信息。 请参阅wtmp手册页获取更多信息。