配置介绍: https://jin-yang.github.io/post/logrotate-usage.html
https://www.cnblogs.com/kevingrace/p/6307298.html (更详细)
centos的触发过程:
所以只需要把配置放到 /etc/logrotate.d/ 下就可以触发。
centos的syslog的配置:
[root@hive-1 ~]# cat /etc/logrotate.d/syslog
/var/log/cron /var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
网友评论