Skip site navigation (1) Skip section navigation (2)

RE: [7.0.2] rotating log files ...

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: Neil Toronto <NToronto(at)Dentrix(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: RE: [7.0.2] rotating log files ...
Date: 2000-08-28 20:52:17
Message-ID: Pine.BSF.4.21.0008281752000.564-100000@thelab.hub.org (view raw or flat)
Thread:
Lists: pgsql-admin
Just as an FYI ... I just enabled the syslog facility so that it all goes
through there instead ...



On Mon, 28 Aug 2000, 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.
> 
> The best way is what Chris said: copy the file, and cat /dev/null > logfile.
> That'll truncate it well.
> 
> -----Original Message-----
> From: Ragnar Kjrstad [mailto:postgres(at)ragnark(dot)vestdata(dot)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
> 

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy(at)hub(dot)org           secondary: scrappy(at){freebsd|postgresql}.org 


In response to

pgsql-admin by date

Next:From: Ragnar KjørstadDate: 2000-08-28 20:58:01
Subject: Re: [7.0.2] rotating log files ...
Previous:From: Neil TorontoDate: 2000-08-28 20:37:24
Subject: RE: [7.0.2] rotating log files ...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group