From owner-freebsd-isp Mon Dec 6 11:21:47 1999 Delivered-To: freebsd-isp@freebsd.org Received: from post.mail.areti.net (meteora.areti.com [193.118.189.10]) by hub.freebsd.org (Postfix) with ESMTP id 78BCD157A9 for ; Mon, 6 Dec 1999 11:21:27 -0800 (PST) (envelope-from ndear@areti.net) Received: from acropolis (acropolis.noc.areti.net [193.118.189.102]) by post.mail.areti.net (8.9.3/8.9.3/Areti-2.0.0) with ESMTP id QAA32337; Mon, 6 Dec 1999 16:27:59 GMT Message-Id: <199912061627.QAA32337@post.mail.areti.net> From: "Nicholas J. Dear" Organization: Areti Internet Ltd. To: "Randy A. Katz" Date: Mon, 6 Dec 1999 16:26:41 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Rotate httpd logs Reply-To: ndear@areti.net Cc: freebsd-isp@FreeBSD.ORG In-reply-to: <3.0.5.32.19991206080611.0356bab0@ccsales.com> X-mailer: Pegasus Mail for Win32 (v3.12b) Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 Our logging is set up so each virtual server has its own directory for logging, but the script could easily be modified if you don't follow this: /usr/local/apache/logs/www.domainame/ rotate.monthly.txt then simply contains a list of "www.domainame" which reflects the directory structure, one on each line. then just bung it into crontab for however often you want it to run. N. -- Nicholas J. Dear Mail: ndear@areti.net Tel: +44 (0)20-8402-4041 Areti Internet Ltd., http://www.areti.co.uk/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message