From owner-freebsd-questions Thu Jun 29 14:43:48 2000 Delivered-To: freebsd-questions@freebsd.org Received: from gateway.sitel.net (gateway.sitel.net [206.24.48.67]) by hub.freebsd.org (Postfix) with SMTP id A0EB237C13A for ; Thu, 29 Jun 2000 14:43:45 -0700 (PDT) (envelope-from jsw@iwww.sitel.net) Received: from [206.24.49.5] by gateway.sitel.net via smtpd (for hub.FreeBSD.ORG [204.216.27.18]) with SMTP; 29 Jun 2000 21:43:45 UT Received: (from jsw@localhost) by iwww.sitel.net (8.9.2/8.9.2) id QAA21431; Thu, 29 Jun 2000 16:43:29 -0500 (CDT) Message-Id: <200006292143.QAA21431@iwww.sitel.net> Subject: Re: Zero'ing out files In-Reply-To: <20000629141519.A316@manatee.mammalia.org> from R Joseph Wright at "Jun 29, 0 02:15:19 pm" To: rjoseph@manatee.mammalia.org (R Joseph Wright) Date: Thu, 29 Jun 2000 16:43:29 -0500 (CDT) Cc: drew@planetwe.com, freebsd-questions@FreeBSD.ORG From: jsw@cywub.sitel.net Reply-To: jsw@cywub.sitel.net X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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