From owner-freebsd-isp Mon Dec 6 14:11:57 1999 Delivered-To: freebsd-isp@freebsd.org Received: from loki.intrepid.net (intrepid.net [204.71.127.3]) by hub.freebsd.org (Postfix) with ESMTP id 0A4A414A05 for ; Mon, 6 Dec 1999 14:11:50 -0800 (PST) (envelope-from mark@loki.intrepid.net) Received: (from mark@localhost) by loki.intrepid.net (8.8.5/8.8.5) id RAA21228; Mon, 6 Dec 1999 17:11:34 -0500 Date: Mon, 6 Dec 1999 17:11:34 -0500 From: Mark Conway Wirt To: "Nicholas J. Dear" Cc: "Randy A. Katz" , freebsd-isp@FreeBSD.ORG Subject: Re: Rotate httpd logs Message-ID: <19991206171134.G8478@intrepid.net> References: <3.0.5.32.19991206080611.0356bab0@ccsales.com> <199912061627.QAA32337@post.mail.areti.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <199912061627.QAA32337@post.mail.areti.net>; from ndear@areti.net on Mon, Dec 06, 1999 at 04:26:41PM -0000 Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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