CentOS7保存系统日志为半年

2022-02-23  本文已影响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 
上一篇 下一篇

猜你喜欢

热点阅读