|
请教各位高手,本人在使用logrotate归档apache log时,想要达到每周回滚,达到500M立即回滚。
配置如下:
more /etc/logrotate.conf
weekly
rotate 4
create
include /etc/logrotate.d
/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}
/usr/local/apache/logs/access_log /usr/local/apache/logs/error_log {
weekly
size=500M
rotate 4
compress
sharedscripts
postrotate
cd /usr/local/apache/logs
/bin/kill -1 `cat /usr/local/apache/logs/httpd.pid`
endscript
}
这样执行下来,size达到500M是可以执行回滚,但不会每周执行。如果去掉size=500M,就可以每周执行,这是什么问题呢? |
|