pg_dumpall in crontab doesn't work - Mailing list pgsql-admin

From Werner Modenbach
Subject pg_dumpall in crontab doesn't work
Date
Msg-id afriab$921$1@news.hub.org
Whole thread Raw
Responses Re: pg_dumpall in crontab doesn't work  (Nils Höglund <nils@naqua.se>)
List pgsql-admin
I'm doing some backup action for my database using crontab. Unfortunately
the following entry doesn't work and I can't figure out the problem:
----------------------------- /etc/crontab ---------------------------
05 22 *  *  1-5 postgres /usr/bin/pg_dumpall -D >
/disks/postgres/db.pg_dumpall
----------------------------------------------------------------------

The message I get is:

---------------------------- stderr ----------------------------------
connected to template1...
/usr/bin/pg_dumpall: 0: Bad file descriptor
----------------------------------------------------------------------

The outputfile looks like:

----------------------- the output file ------------------------------
--
-- 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 "martin" WITH SYSID 101 NOCREATEDB NOCREATEUSER;
CREATE USER "juergen" WITH SYSID 102 CREATEDB NOCREATEUSER;
CREATE USER "www" WITH SYSID 103 NOCREATEDB NOCREATEUSER;
CREATE USER "procad" WITH SYSID 99 NOCREATEDB NOCREATEUSER;

DELETE FROM pg_group;
----------------------------------------------------------------------

That's all. No databases dumped. Calling pg_dumpall manually works fine.
Whe is the problem? Any hints?

- Werner -



pgsql-admin by date:

Previous
From: "Robson"
Date:
Subject: Too many clients already.
Next
From: "Simeone, Mario"
Date:
Subject: