From owner-freebsd-isp Tue Dec 7 2:47:58 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 1CAB914E2D for ; Tue, 7 Dec 1999 02:47:53 -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 KAA10785; Tue, 7 Dec 1999 10:47:41 GMT Message-Id: <199912071047.KAA10785@post.mail.areti.net> From: "Nicholas J. Dear" Organization: Areti Internet Ltd. To: Alexander Leidinger Date: Tue, 7 Dec 1999 10:46:19 -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: randyk@ccsales.com, freebsd-isp@FreeBSD.ORG In-reply-to: <199912070924.KAA00931@Magelan.Leidinger.net> References: <199912061627.QAA32337@post.mail.areti.net> X-mailer: Pegasus Mail for Win32 (v3.12b) Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 7 Dec 99, at 10:24, Alexander Leidinger wrote: > What do you mean with "it went kinda wild"? It spawned about 30 copies of itself, and then apache died. > > #!/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 > > You loose some lines of logging in the worst case with this script. > You should first mv the file, restart apache and then gzip it. > Or you could do a mv, apachectl graceful, sleep, gzip (no open > connection is closed with "graceful", but you need to wait a little bit > to be sure the logs are really closed). Very true. I've modified my script. Thanks, 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