Hi Steve, I have changed my script to:
#! /bin/bash PATH=/usr/local/pgsql/bin:/bin:/usr/kerberos/bin:/usr/local/java/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/ant/bin:. PGHOME=/usr/local/pgsql PGUSER=postgres PGDATABASE=canon PGHOST=localhost PGPASSFILE=/usr/local/pgsql/.pgpass PGDATA=/usr/local/pgsql/data LD_LIBRARY_PATH=/usr/local/pgsql/lib export PGUSER PGDATABASE PGHOST PGPASSFILE PGDATA LD_LIBRARY_PATH export PGHOME PATH echo +++++++++ echo PGUSER: $PGUSER echo PGDATABASE: $PGDATABASE echo PGHOST: $PGHOST echo PGPASSFILE: $PGPASSFILE echo PGDATA: $PGDATA echo HOME: $HOME echo PATH: $PATH filename=`date +%G%m%d.%w`.gz /usr/local/pgsql/bin/pg_dumpall > $filename And here's the result: +++++++++ PGUSER: postgres PGDATABASE: canon PGHOST: localhost PGPASSFILE: /usr/local/pgsql/.pgpass PGDATA: /usr/local/pgsql/data HOME: /usr/local/pgsql PATH: /usr/local/pgsql/bin:/bin:/usr/kerberos/bin:/usr/local/java/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/ant/bin:. Password: pg_dumpall: could not connect to database "template1": fe_sendauth: no password supplied As you can see, I am afraid my point still holds. Regards, Tena Sakai [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] on behalf of Steve Holdoway Sent: Wed 2/27/2008 7:33 PM To: pgsql-admin@postgresql.org Subject: Re: [ADMIN] trouble with pg_dumpall On Wed, 27 Feb 2008 17:12:40 -0800 "Tena Sakai" <[EMAIL PROTECTED]> wrote: Here's your problem. > . .bashrc You have an extremely minimal environment when running from cron, and you certainly *aren't* running from the home directory of the relevant user. You need to set up your PATH and HOME manually, and cd to your home directory before sourcing .bashrc for this to work. . ~/.bashrc *might* work, but it's better to be specific (: hth, Steve -- Steve Holdoway <[EMAIL PROTECTED]> ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq