On Wed, 27 Feb 2008, Tena Sakai wrote:
> +++++++++
> 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
Hey Tena,
What user is this script running as when running under cron?
Might be time to break out strace and run it like this:
strace -fe trace=file /usr/local/pgsql/bin/pg_dumpall > $filename 2> strace.out
>
> As you can see, I am afraid my point still holds.
>
> Regards,
>
> Tena Sakai
> tsakai@gallo.ucsf.edu
>
>
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org 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" <tsakai@gallo.ucsf.edu> 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
directoryof 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
>
>
--
Jeff Frost, Owner <jeff@frostconsultingllc.com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954