Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id DD100476966 for ; Wed, 19 Jun 2002 03:58:01 -0400 (EDT) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id A760447684A for ; Wed, 19 Jun 2002 03:45:10 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 4BEA738128B; Wed, 19 Jun 2002 03:44:43 -0400 (EDT) From: Werner Modenbach X-Newsgroups: comp.databases.postgresql.admin Subject: pg_dumpall fails in cronjob Date: Wed, 19 Jun 2002 09:44:01 +0200 Organization: ALC Computertechnik GmbH Lines: 41 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: news@hub.org User-Agent: KNode/0.7.1 To: pgsql-admin@postgresql.org X-Archive-Number: 200206/179 X-Sequence-Number: 4613 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