Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jun 2000 16:38:11 -0400 (EDT)
From:      Damon Hammis <squirrel@hammis.com>
To:        Drew Sanford <drew@planetwe.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: Zero'ing out files
Message-ID:  <Pine.BSF.4.10.10006291636070.62419-100000@markl.com>
In-Reply-To: <395BAFAC.2769ADA5@planetwe.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I believe that Apache has a script called rotatelogs that should work for
what you are looking for.  I wrote a simple script to handle my logs and
put it in cron.  It's below if you want to try it.

#!/bin/sh
DATE=`date +%m%d%Y`
mv /var/log/web/httpd-access.log
/var/log/web/archives/httpd-access.log.$DATE
/usr/local/sbin/apachectl graceful
gzip /var/log/web/archives/httpd-access.log.$DATE

Of course, this allows me to archive the logs daily, but it seems to work
well.

--Damon

On Thu, 29 Jun 2000, Drew Sanford wrote:

> Is there a way to zero out a file, and still leave it open, say for an
> apache access log? If there is a simple way to rotate the access logs
> (is there a way to make newsyslog work for this?) then you can answer
> that one two if you like. My git instinct is that I'm going to have to
> write a script and let cron run it, because I simply haven't seen
> anything besides newsyslog that archives the old logs. Thanks in advance
> for any help you can offer.
> -- 
> Drew Sanford
> Systems Administrator
> Planetwe.com
> Email: drew@planetwe.com
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10006291636070.62419-100000>