Re: Database backup

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: dima <_pppp(at)mail(dot)ru>
Cc: "Panchal, Ritesh" <RPanchal(at)netopia(dot)com>, "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Database backup
Date: 2003-02-13 17:58:02
Message-ID: 1045159082.10910.14.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, 2003-02-13 at 08:53, dima wrote:
> > I am trying to automate my backups using pg_dump. However, I am not able to
> > pass the password to the command. Has anybody sucessfully done automated
> > backup thru scripts?
> export PGPASSWORD=password && pg_dump ... && export PGPASSWORD=""

Presumably the second export is to conceal PGPASSWORD; it would not be
executed if pg_dump were to fail, because && means execute the following
pipeline only if the previous command succeeds. This should read:

export PGPASSWORD=password && pg_dump ... ; export PGPASSWORD=""

Better than this is to use ~/.pgpass, which is a new feature in 7.3.
That would not expose the administrator's password to being scanned in
the process table. Use of ~/.pgpass is described in the libpq manual,
section 1.11

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"The earth is the LORD'S, and the fullness thereof; the
world, and they that dwell therein."
Psalms 24:1

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Andres Ledesma 2003-02-13 19:21:50 Re: [ADMIN] help me!!
Previous Message King_Henree@yahoo.com 2003-02-13 16:45:14 What other parameters to consider when increasing max connections?