Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Dec 1999 10:46:19 -0000
From:      "Nicholas J. Dear" <ndear@areti.net>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        randyk@ccsales.com, freebsd-isp@FreeBSD.ORG
Subject:   Re: Rotate httpd logs
Message-ID:  <199912071047.KAA10785@post.mail.areti.net>
In-Reply-To: <199912070924.KAA00931@Magelan.Leidinger.net>
References:  <199912061627.QAA32337@post.mail.areti.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912071047.KAA10785>