-->
在/etc/logrotate.conf中填加
/usr/local/httpd/logs/access.log /usr/local/httpd/logs/error.log {
daily
rotate 5
sharedscripts
postrotate
/bin/kill -HUP `cat /usr/local/httpd/logs/httpd.pid`
endscript
}
设定web服务器日志文件每天轮转一次,保留5份日志文件,日志轮转结束运行命令 /bin/kill -HUP `cat /usr/local/httpd/logs/httpd.pid`
需要使用其它选项可查看logrotate手册页

发表评论