pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Toronto <NToronto@Dentrix.com>
To: pgsql-admin@postgresql.org
Subject: RE: [7.0.2] rotating log files ...
Date: Mon, 28 Aug 2000 14:37:24 -0600
Message-ID: <14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com> (raw)

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



view thread (17+ messages)  latest in thread

Message-ID: <14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com>
Permalink:  ../14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com/
Also on:    postgresql.org/message-id/14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: NToronto@Dentrix.com
  Subject: Re: [7.0.2] rotating log files ...
  In-Reply-To: <14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com>
  References: <14A4DCD7F3CED3118749009027DCBFE4C81EFC@smtp.stsrvcs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox