美文网首页
CentOS7保存系统日志为半年

CentOS7保存系统日志为半年

作者: 风静花犹落 | 来源:发表于2022-02-23 17:34 被阅读0次

编辑

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 

相关文章

网友评论

      本文标题:CentOS7保存系统日志为半年

      本文链接:https://www.haomeiwen.com/subject/qaoolrtx.html