编辑
vim /etc/logrotate.conf
修改
# keep 4 weeks worth of backlogs
# 默认保存4周,这里修改为24周也就是半年
rotate 24
# no packages own wtmp and btmp -- we'll rotate them here
# 将rotate 1 改为rotate 3
/var/log/wtmp {
monthly
create 0664 root utmp
minsize 1M
rotate 3
}
重启
systemctl restart rsyslog
网友评论