logrotate
docs
- man logrotate
troubleshootings
日志异常
如上强制logrotate ,执行以下步骤。
logrotate -v -f /etc/logrotate.d/kernel-message
重命名当前日志
renaming /var/log/messages to /var/log/messages-20180827
压缩文件
compressing log with: /bin/gzip
默认的文件已经不在了。
root@350-tf-s2 /var/log# ls -lhS message*
ls -lhS kern*
-rw-r----- 1 root adm 1.6M Aug 26 06:25 messages-20180826.gz
-rw-r----- 1 root adm 353K Aug 27 15:19 messages-20180827.gz
root@350-tf-s2 /var/log# ls -lhS kern*
-rw-r----- 1 root adm 1.5M Aug 26 06:25 kern.log-20180826.gz
-rw-r----- 1 root adm 334K Aug 27 15:17 kern.log-20180827.gz
还不快抢沙发