3
logrotate不压缩/ var / log / messages
随着时间的推移,我注意到一些日志/var/log,例如auth,kern并且messages变得越来越大。我logrotate为他们输入了: $ cat /etc/logrotate.d/auth.log /var/log/kern.log { rotate 5 daily } $ cat /etc/logrotate.d/kern.log /var/log/kern.log { rotate 5 daily } $ cat /etc/logrotate.d/messages /var/log/messages { rotate 5 daily postrotate /bin/killall -HUP syslogd endscript } 我也compress启用了该选项: $ grep compress /etc/logrotate.conf # uncomment this if you want your log files compressed compress 这个伟大工程auth.log,kern.log和其他人,这意味着每个这些日志被gzip压缩和旋转,用日志的最近5天保留。/var/log/messages但是未压缩,因此导致超过5天的日志记录: …