Received: from stine.vestdata.no (IDENT:0@stine.vestdata.no [195.204.68.10]) by hub.org (8.10.1/8.10.1) with ESMTP id e7SL7IC40221 for ; Mon, 28 Aug 2000 17:07:18 -0400 (EDT) Received: (from ragnark@localhost) by stine.vestdata.no (8.9.3/8.9.3) id XAA20776; Mon, 28 Aug 2000 23:07:12 +0200 Date: Mon, 28 Aug 2000 23:07:11 +0200 From: =?iso-8859-1?Q?Ragnar_Kj=F8rstad?= To: Neil Toronto Cc: pgsql-admin@postgresql.org Subject: Re: [7.0.2] rotating log files ... Message-ID: <20000828230711.D19112@vestdata.no> References: <14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com>; from Neil Toronto on Mon, Aug 28, 2000 at 02:37:24PM -0600 X-Archive-Number: 200008/73 On Mon, Aug 28, 2000 at 02:37:24PM -0600, Neil Toronto wrote: > The process still has an open file handle, and will continue to do so even > after you move it. So, if your file is /var/log/messages, and you do a mv > /var/log/messages /var/log/messages.old or something (I know that's stupid, > but this is an example), the process will continue to write to > /var/log/messages.old. Naturally, you need to HUP the process when you're done moving the file. (and ofcourse, you need to have the rotated version on the same filesystem) > The best way is what Chris said: copy the file, and cat /dev/null > logfile. > That'll truncate it well. Copying the file will take much longer, and you might loose log-entries that are written after cp but before truncate. -- Ragnar Kjorstad