On Tue, 25 Mar 2003, Flower Sun wrote:
>
> Hi, group,
>
> Does any one of you write log rotation script for postgresql server output? Can you share with us?
>
> shell> pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/logfiles/activity.log -o -i
I use rotatelogs from the apache package. Make sure it's in the postgres
super user's path, create a directory for the logs that the postgres
user can write to (I use $PGDATA/pglog here) then put this line in
rc.local:
su - postgres -c 'pg_ctl start | rotatelogs $PGDATA/pglog 86400 2>1&'
Note that that's apache 1.3.x. I haven't really had time or a need to
look at 2.x apache yet.