lighttpd,如何设置日志轮循?

来源:百度知道 编辑:UC知道 时间:2024/05/23 17:23:11

在/etc/logrotate.d/下创建一个文件lighttpd 内容为:
/var/log/lighttpd/*.log {
weekly
missingok
copytruncate
rotate 12
compress
notifempty
sharedscripts
postrotate
if [ -f /var/run/lighttpd.pid ]; then \
if [ -x /usr/sbin/invoke-rc.d ]; then \
invoke-rc.d lighttpd reload > /dev/null 2>&1; \
else \
/etc/init.d/lighttpd reload > /dev/null 2>&1; \
fi; \
fi;
endscript
}