Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jun 2000 16:43:29 -0500 (CDT)
From:      jsw@cywub.sitel.net
To:        rjoseph@manatee.mammalia.org (R Joseph Wright)
Cc:        drew@planetwe.com, freebsd-questions@FreeBSD.ORG
Subject:   Re: Zero'ing out files
Message-ID:  <200006292143.QAA21431@iwww.sitel.net>
In-Reply-To: <20000629141519.A316@manatee.mammalia.org> from R Joseph Wright at "Jun 29, 0 02:15:19 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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
> 
> How about "cat /dev/null > file" ?

We use a script that runs right after midnight to do this.  Hasn't failed
yet, although I can see where maybe one detail line might be lost.

mv access_log access.old
true >access_log

Assuming a hit does not come in at the very instant, it should be a clean
solution.

Good day      JSW


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?200006292143.QAA21431>