Date: Mon, 6 Dec 1999 17:11:34 -0500 From: Mark Conway Wirt <mark@intrepid.net> To: "Nicholas J. Dear" <ndear@areti.net> Cc: "Randy A. Katz" <randyk@ccsales.com>, freebsd-isp@FreeBSD.ORG Subject: Re: Rotate httpd logs Message-ID: <19991206171134.G8478@intrepid.net> In-Reply-To: <199912061627.QAA32337@post.mail.areti.net>; from ndear@areti.net on Mon, Dec 06, 1999 at 04:26:41PM -0000 References: <3.0.5.32.19991206080611.0356bab0@ccsales.com> <199912061627.QAA32337@post.mail.areti.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 06, 1999 at 04:26:41PM -0000, Nicholas J. Dear wrote: > On 6 Dec 99, at 8:06, Randy A. Katz wrote: > > > Hi, > > > > Just trying to get a clue about how I should rotate httpd logs, how > > frequently, and whether to use rotatelogs (included in Apache) or something > > else. If any of you could share your methods I'd appreciate it. > > I did try using rotatelogs and it went kinda wild, so I wrote my own simple script to do this via crontab. > > #!/bin/sh > TODAY=`date +%Y-%m-%d` > for x in `/bin/cat /var/log/www/rotate.monthly.txt` ; do cd /usr/local/apache/logs/$x ; gzip access_log ; mv access_log.gz access_log.$TODAY.gz ; done > /usr/local/apache/bin/apachectl restart > /dev/null However you so it, it's important to HUP apache or "restart" the server (as above) after you've zeroed the files. --mark -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991206171134.G8478>