From: Oliver Elphick <olly@lfix.co.uk>
To: dima <_pppp@mail.ru>
Cc: Panchal, Ritesh <RPanchal@netopia.com>
Cc: 'pgsql-admin@postgresql.org' <pgsql-admin@postgresql.org>
Subject: Re: Database backup
Date: 13 Feb 2003 17:58:02 +0000
Message-ID: <1045159082.10910.14.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <3E4B5D0F.3020702@mail.ru>
References: <D778DFCC08F53A41B4895A659888966629C1E9@mxca1.netopia.com>
<3E4B5D0F.3020702@mail.ru>
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.Elphick@lfix.co.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: olly@lfix.co.uk, _pppp@mail.ru, RPanchal@netopia.com
Subject: Re: Database backup
In-Reply-To: <1045159082.10910.14.camel@linda.lfix.co.uk>
References: <D778DFCC08F53A41B4895A659888966629C1E9@mxca1.netopia.com> <3E4B5D0F.3020702@mail.ru> <1045159082.10910.14.camel@linda.lfix.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox