Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jul 2008 15:51:25 +0300
From:      Volodymyr Kostyrko <c.kworr@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: log size handling
Message-ID:  <g5nf8e$bc2$1@ger.gmane.org>
In-Reply-To: <200807170904.26354.mario.lobo@ipad.com.br>
References:  <487F2525.3030304@lcwords.com>	<20080717072023.4b9e1d2f.wmoran@potentialtech.com>	<487F2D9B.2010407@lcwords.com> <200807170904.26354.mario.lobo@ipad.com.br>

next in thread | previous in thread | raw e-mail | index | archive | help
Mario Lobo wrote:
> On Thursday 17 July 2008, Zbigniew Szalbot wrote:

> What would be the proper way to set the rotation of apache logs in 
> newsyslog.conf when there are separate log files for each virtual host?

/var/log/httpd/*.log www:wheel 644 7 102400 * JG /var/run/httpd.pid 30

> Do I have to rotate them myself via a script in crontab?

If you want it.

ls /var/log/httpd/*.bz2 | sed 's|\.\([0-9]*\)\.|,\1,|' | awk 
'BEGIN{FS=","}{print"mv "$1"."$2"."$3" "$1"."$2+1"."$3}' | sh
ls /var/log/httpd/*.log | xargs -n1 -Ifoo mv foo foo.0
kill -30 `cat /var/run/httpd.pid`
sleep 1
bzip2 -9 /var/log/httpd/*.0
find /var/log/httpd/ -type -f -mtime +7 -delete

-- 
Sphinx of black quartz judge my vow.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?g5nf8e$bc2$1>