linux设置日志文件保存时间为6个月(/etc/logrotate.conf)

1、编辑/etc/logrotate.conf文件

将全局的weekly下的rotate 4改为rotate 24,表示6个月;

将指定文件的monthly下的rotate 1改为rotate 6,表示6个月。

 2、重启日志服务

service rsyslog restart

猜你喜欢

转载自blog.csdn.net/hjxloveqsx/article/details/129010572