/usr/local/apache2/logs/*log {
monthly
rotate 3
}但这样还不够,因为日志轮转后,如果不重启 httpd 进程,那么日志就会写到 access_log.1 中。可以在 logroate 配置中通过如下方法来指定重启:postrotate
/bin/kill -HUP `cat /usr/local/apache2/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
没有评论:
发表评论