Received: from bastuba.partitur.se ([212.209.169.194]) by hub.org (8.10.1/8.10.1) with ESMTP id e7SNacC64820 for ; Mon, 28 Aug 2000 19:36:38 -0400 (EDT) Received: from stordatan.palle.se (c193.150.250.87.cm-upc.chello.se [193.150.250.87]) by bastuba.partitur.se (8.9.3/8.9.3) with ESMTP id BAA71850; Tue, 29 Aug 2000 01:36:35 +0200 (CEST) (envelope-from girgen@partitur.se) Received: from partitur.se (localhost [127.0.0.1]) by stordatan.palle.se (8.9.3/8.9.3) with ESMTP id BAA13502; Tue, 29 Aug 2000 01:36:34 +0200 (CEST) (envelope-from girgen@partitur.se) Message-ID: <39AAF782.5E5B392C@partitur.se> Date: Tue, 29 Aug 2000 01:36:34 +0200 From: Palle Girgensohn Organization: Partitur X-Mailer: Mozilla 4.75 [en] (X11; U; FreeBSD 4.1-STABLE i386) X-Accept-Language: sv, en MIME-Version: 1.0 To: The Hermit Hacker CC: pgsql-admin@postgresql.org Subject: Re: [7.0.2] rotating log files ... References: Content-Type: multipart/mixed; boundary="------------B56AF1F680408A3AEDC78CFE" X-Archive-Number: 200008/74 This is a multi-part message in MIME format. --------------B56AF1F680408A3AEDC78CFE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, Apart from using syslog, which apparently work fine (?) with 7.0.2, the 'rotatelogs' utility from apache's support dir is great (No need to hack one up, as Alfred Perlstein suggest; this babe been around and is quite stable). Of course, you need to stop the server once, but I guess other ways have been thouroughly dicussed in already :) Enclosed is a Bournce shell script showing how I start postgres on developers' machines [debug on] (run as root, will su pgsql) On syslog... is syslog support reliable now? If so, admin/pg-options.htm should be updated: ...Unfortunately many functions call directly printf() to print their messages to stdout or stderr and this output can't be redirected to syslog or have timestamps in it.... Cheers, Palle The Hermit Hacker wrote: > > can someone recommend on how to rotate the following log files without > having to stop/start the server? ... > suggestions? > > Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy > Systems Administrator @ hub.org > primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org --------------B56AF1F680408A3AEDC78CFE Content-Type: application/x-sh; name="010.pgsql.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="010.pgsql.sh" #!/bin/sh # # $Id: 010.pgsql.sh.in,v 1.4 2000/03/22 14:20:31 henrik Exp $ # # $FreeBSD: ports/databases/postgresql7/files/pgsql.sh.tmpl,v 1.8 2000/05/25 09:35:25 andreas Exp $ # # For postmaster startup options, edit $PGDATA/postmaster.opts.default # Preinstalled options are -i -o "-F" case $1 in start) [ -d /var/log/pgsql ] || install -d -o pgsql /var/log/pgsql [ -d /usr/local/pgsql/lib ] && /sbin/ldconfig -m /usr/local/pgsql/lib [ -x /usr/local/pgsql/bin/pg_ctl ] && { su -l pgsql -c \ 'exec /usr/local/pgsql/bin/pg_ctl -w -D /opt/pgsql/data start 2>&1 | /usr/local/sbin/rotatelogs /var/log/pgsql/pgsql 86400 &' echo -n ' pgsql' } ;; stop) [ -x /usr/local/pgsql/bin/pg_ctl ] && { su -l pgsql -c 'exec /usr/local/pgsql/bin/pg_ctl -w -D /opt/pgsql/data -m fast stop' } ;; status) [ -x /usr/local/pgsql/bin/pg_ctl ] && { su -l pgsql -c 'exec /usr/local/pgsql/bin/pg_ctl -D /opt/pgsql/data status' } ;; *) echo "usage: `basename $0` {start|stop|status}" >&2 exit 64 ;; esac --------------B56AF1F680408A3AEDC78CFE--