Re: trouble with pg_dumpall

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Title: RE: trouble with pg_dumpall

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
tsakai@xxxxxxxxxxxxxx


-----Original Message-----
From: pgsql-admin-owner@xxxxxxxxxxxxxx on behalf of Steve Holdoway
Sent: Wed 2/27/2008 7:33 PM
To: pgsql-admin@xxxxxxxxxxxxxx
Subject: Re: trouble with pg_dumpall

On Wed, 27 Feb 2008 17:12:40 -0800
"Tena Sakai" <tsakai@xxxxxxxxxxxxxx> 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 <steve.holdoway@xxxxxxxxxxxxx>

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux