Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 84C4E633085 for ; Wed, 3 Feb 2010 20:56:30 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 54676-04 for ; Thu, 4 Feb 2010 00:56:03 +0000 (UTC) X-Greylist: delayed 00:09:29.856966 by SQLgrey-1.7.6 Received: from avas-mr15.fibertel.com.ar (avas-mr15.fibertel.com.ar [24.232.0.247]) by mail.postgresql.org (Postfix) with ESMTP id A0AB0633AE8 for ; Wed, 3 Feb 2010 20:56:19 -0400 (AST) Received: from 48-184-247-190.fibertel.com.ar ([190.247.184.48]:63955 "EHLO [192.168.0.109]" smtp-auth: "ultragestion" rhost-flags-OK-FAIL-OK-FAIL) by avas-mr15.fibertel.com.ar with ESMTPA id S474289Ab0BDAqk; Wed, 3 Feb 2010 21:46:40 -0300 Subject: Re: How to clear log files From: Gabriel Parrondo To: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Organization: Cuspide Computacion Date: Wed, 03 Feb 2010 21:46:39 -0300 Message-Id: <1265244399.2838.4.camel@debian2> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 8bit X-Fib-Al-Info: Al X-Fib-Al-MRId: 5f1a812bb03c923d74fed4467a71604c X-Fib-Al: noav X-Fib-Al-SA: analyzed X-Fib-Al-From: gabriel.parrondo@ultragestion.com.ar X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201002/44 X-Sequence-Number: 33647 El mié, 03-02-2010 a las 15:12 -0600, Campbell, Lance escribió: > PostgreSql:8.4.1 > > Is there a way for me to tell postgres to clear the log file. > Example: I have log files created with names corresponding to the > days of the week. This way they overwrite each other every week. > When I deploy software enhancements I would like to clear the log file > for the day without having to stop postgres. This way anything I see > I know was after the deployment of my enhancements. I tried to just > delete the file with postgres running. I found that it did not > recreate the log file so I was forced to restart postgres. > Actually, when you delete an opened file it isn't really deleted. Whatever program opened it can still read/write to it using the file descriptor. > Is there a command that might clear a log file or force it to rotate? Truncating it like this should work: echo > /path/to/logfile There's probably a better way though.