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.

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to