pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Ryan <chris@greatbridge.com>
To: Mitch Vincent <mitch@venux.net>
Cc: The Hermit Hacker <scrappy@hub.org>
Cc: pgsql-admin@postgresql.org
Subject: Re: [7.0.2] rotating log files ...
Date: Mon, 28 Aug 2000 14:31:29 -0400
Message-ID: <39AAB001.59903034@greatbridge.com> (raw)
References: <Pine.BSF.4.21.0008281456510.564-100000@thelab.hub.org>
	<00c501c0111d$7e1dcd60$0200000a@doot>

It's not normally a good idea to move/remove files that a process has an
open file handle for. The safest way is to copy the file to a new
location/name then cat /dev/null > logfile

Chris

Mitch Vincent wrote:
> 
> Can you move the logfile then touch the original file to create an empty
> one?
> 
> *shrug* just an idea :-)
> 
> -Mitch
> 
> ----- Original Message -----
> From: "The Hermit Hacker" <scrappy@hub.org>
> To: <pgsql-admin@postgresql.org>
> Sent: Monday, August 28, 2000 10:59 AM
> Subject: [ADMIN] [7.0.2] rotating log files ...
> 
> >
> > can someone recommend on how to rotate the following log files without
> > having to stop/start the server?
> >
> > postgres 85333 pgsql    1w  VREG  13,131084       995 762037
> /pgsql/logs/postmaster.5432.61308
> > postgres 85333 pgsql    2w  VREG  13,131084 316501241 762038
> /pgsql/logs/5432.61308
> >
> > its the 316meg one and growing that I'm more interested in doing,
> obviously ...
> >
> > I'm starting my postmaster as:
> >
> > #!/bin/tcsh
> > setenv PORT 5432
> > setenv POSTMASTER /pgsql/bin/postmaster
> > unlimit
> > ${POSTMASTER} -B 384 -N 192 \
> >               -o "-F -o /pgsql/logs/${PORT}.$$ -S 32768" \
> >               -i -p ${PORT} -D/pgsql/data >&
> /pgsql/logs/postmaster.${PORT}.$$ &
> >
> > where I was hoping that the '-o /pgsql/logs/${PORT}.$$' would create a
> > 'per postgres process' log file, but $$ is taking on the PID of the parent
> > process, not the children ...
> >
> > suggestions?
> >
> > Marc G. Fournier                   ICQ#7615664               IRC Nick:
> Scrappy
> > Systems Administrator @ hub.org
> > primary: scrappy@hub.org           secondary:
> scrappy@{freebsd|postgresql}.org
> >
> >



view thread (17+ messages)  latest in thread

Message-ID: <39AAB001.59903034@greatbridge.com>
Permalink:  ../39AAB001.59903034@greatbridge.com/
Also on:    postgresql.org/message-id/39AAB001.59903034@greatbridge.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: chris@greatbridge.com, mitch@venux.net, scrappy@hub.org
  Subject: Re: [7.0.2] rotating log files ...
  In-Reply-To: <39AAB001.59903034@greatbridge.com>
  References: <Pine.BSF.4.21.0008281456510.564-100000@thelab.hub.org> <00c501c0111d$7e1dcd60$0200000a@doot> <39AAB001.59903034@greatbridge.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