Received: from exchange.dentrix.com (smtp.stsrvcs.com [38.168.223.2] (may be forged)) by hub.org (8.10.1/8.10.1) with ESMTP id e7SKemC31786 for ; Mon, 28 Aug 2000 16:40:48 -0400 (EDT) Received: by smtp.stsrvcs.com with Internet Mail Service (5.5.2650.21) id ; Mon, 28 Aug 2000 14:37:30 -0600 Message-ID: <14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com> From: Neil Toronto To: pgsql-admin@postgresql.org Subject: RE: [7.0.2] rotating log files ... Date: Mon, 28 Aug 2000 14:37:24 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id e7SKenC31788 X-Archive-Number: 200008/70 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. The best way is what Chris said: copy the file, and cat /dev/null > logfile. That'll truncate it well. -----Original Message----- From: Ragnar Kjørstad [mailto:postgres@ragnark.vestdata.no] What's wrong with moving the file when it's in use? Copying the file will take much longer, and you might loose log-entries that are written after cp but before truncate. -- Ragnar Kjorstad