From: Werner Modenbach <modenbach@alc.de>
To: pgsql-admin@postgresql.org
Subject: pg_dumpall fails in cronjob
Date: Wed, 19 Jun 2002 09:44:01 +0200
Message-ID: <aepcpb$m6r$1@news.hub.org> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: modenbach@alc.de
Subject: Re: pg_dumpall fails in cronjob
In-Reply-To: <aepcpb$m6r$1@news.hub.org>
References: <aepcpb$m6r$1@news.hub.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox