Re: rotatelog / logrotate with PostgreSQL

From: Roland Roberts <roland(at)astrofoto(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: rotatelog / logrotate with PostgreSQL
Date: 2002-09-24 14:36:42
Message-ID: m2ofanv4hx.fsf@kuiper.rlent.pnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

Tom> "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com> writes:
>> Can someone send an example of how they have the
>> logrotate / rotatelog script working with PostgreSQL?

Tom> Should work to just pipe the postmaster's stderr into it, eg

Tom> postmaster ... 2>&1 | logrotate ... &

Huh? logrotate moves a log file, it doesn't log anything.

Does the postmaster close the log after writing? logrotate can move
the log and create a new (empty) one, but if the postmaster has the
log open, it will continue to write to the old one, defeating the
purpose of rotating the log. Also, if logrotate is configured to
compress the log after rotating, an open connection will result in the
tail of the file being "corrupted" since uncompressed data will be
appended.

So I'm curious too as to how it works; I haven't tried anything at
this point....

roland
--
PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD RL Enterprises
roland(at)rlenter(dot)com 76-15 113th Street, Apt 3B
roland(at)astrofoto(dot)org Forest Hills, NY 11375

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roland Roberts 2002-09-24 14:42:02 Re: OID order = INSERT order?
Previous Message Tourtounis Sotiris 2002-09-24 14:24:24 Re: Number of disk pages obtained by explain analyze (fwd)