X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8CE49474E4F for ; Thu, 13 Feb 2003 12:58:02 -0500 (EST) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id F1355474E42 for ; Thu, 13 Feb 2003 12:58:01 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 18jNcZ-0006eH-0Z; Thu, 13 Feb 2003 17:58:03 +0000 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 18jNcY-0002vP-00; Thu, 13 Feb 2003 17:58:02 +0000 Subject: Re: Database backup From: Oliver Elphick To: dima <_pppp@mail.ru> Cc: "Panchal, Ritesh" , "'pgsql-admin@postgresql.org'" In-Reply-To: <3E4B5D0F.3020702@mail.ru> References: <3E4B5D0F.3020702@mail.ru> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1045159082.10910.14.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 13 Feb 2003 17:58:02 +0000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/188 X-Sequence-Number: 7386 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