Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AD215475E45 for ; Thu, 30 Jan 2003 07:40:09 -0500 (EST) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by postgresql.org (Postfix) with ESMTP id D51BE475AAC for ; Thu, 30 Jan 2003 07:40:08 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 18eDzG-0001wu-0W; Thu, 30 Jan 2003 12:40:11 +0000 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 18eDzG-0000hN-00; Thu, 30 Jan 2003 12:40:10 +0000 Subject: Re: Postgres server output log From: Oliver Elphick To: "Rajesh Kumar Mallah." Cc: Mintoo Lall , pgsql-admin@postgresql.org In-Reply-To: <200301301052.36984.mallah@trade-india.com> References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1043930409.1112.203.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 Date: 30 Jan 2003 12:40:10 +0000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/336 X-Sequence-Number: 7178 On Thu, 2003-01-30 at 05:22, Rajesh Kumar Mallah. wrote: > > This is someones' elses' posting that i have preserved > shud be useful. ... > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` > > Well, > the most correct way to do a logrotate is ( Redhat ): ... > 2) Put on the directory /etc/logrotate.d a file called > 'postgres' with the following lines: > > /var/log/postgresql.log { > compress > rotate 2 > size=10000k > errors mendola@bigfoot.com > create 0664 postgres postgres > daily > postrotate > /usr/bin/killall -HUP syslogd > endscript > } ... This won't work as it stands with PostgreSQL, because the hangup signal does not make the postmaster reopen the log file. Instead of that postrotate section, you need to use logrotate's copytruncate option, which will copy the logfile to another file before zeroing the logfile. Depending on what is being logged, you may want to change the permissions to 660; there may be stuff in the logs that you don't want to reveal to the world. (With copytruncate, I think the create option applies to the copy files rather than to the original logfile.) -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "The Lord knoweth how to deliver the godly out of temptations, and to reserve the unjust unto the day of judgment to be punished;" II Peter 2:9