pg_dumpall fails in cronjob

From: Werner Modenbach <modenbach(at)alc(dot)de>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_dumpall fails in cronjob
Date: 2002-06-19 07:44:01
Message-ID: aepcpb$m6r$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi all,

I have a stange problem when executing pg_dumpall as a cron job.

The crontab entry looks like:
05 22 * * 1-5 postgres /usr/bin/pg_dumpall -D >
/disks/postgres/db.pg_dumpall

On stderr I get the message
connected to template1...
/usr/bin/pg_dumpall: 0: Bad file descriptor

The createt dumpfile looks like:
--
-- pg_dumpall (7.2) -D
--
\connect template1
DELETE FROM pg_shadow WHERE usesysid <> (SELECT datdba FROM pg_database
WHERE datname = 'template0');

CREATE USER "werner" WITH SYSID 100 CREATEDB CREATEUSER;
CREATE USER .... // more users

DELETE FROM pg_group;

There are no further lines in here.

When calling
# /disks/postgres/db.pg_dumpall -D > /disks/postgres/db.pg_dumpall'
manually as user postgres the dumpfile continues like:

--
-- Database alc
--
\connect template1 werner
CREATE DATABASE "alc" WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII';
etc.
etc.

What is the reason for this strange behaviour?
I'm using PostgreSQL 7.2

Browse pgsql-admin by date

  From Date Subject
Next Message Heni Lolov 2002-06-19 08:17:05 Re: create table permission
Previous Message girija nagaraj 2002-06-19 05:28:42 he "pg_encoding_to_char" error