X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B93F6D1B547 for ; Thu, 16 Oct 2003 01:59:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 89126-06 for ; Wed, 15 Oct 2003 22:58:55 -0300 (ADT) Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by svr1.postgresql.org (Postfix) with ESMTP id 13C47D1B533 for ; Wed, 15 Oct 2003 22:58:49 -0300 (ADT) Received: from oasis.net.au (guardian [210.8.139.5]) by water.oasis.net.au (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id MAA16478; Thu, 16 Oct 2003 12:27:45 +1000 X-Authentication-Warning: water.oasis.net.au: Host guardian [210.8.139.5] claimed to be oasis.net.au Message-ID: <3F8DFCC9.5090603@oasis.net.au> Date: Thu, 16 Oct 2003 12:04:57 +1000 From: Rudi Starcevic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesan Kanavathy Cc: pgsql-admin@postgresql.org Subject: Re: pg_dump.. auto backup References: <000001c39385$f0491280$1300a8c0@headquarters.mq.com> In-Reply-To: <000001c39385$f0491280$1300a8c0@headquarters.mq.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/165 X-Sequence-Number: 10726 Ganesan Kanavathy wrote: > I am doing a cronjob to dump pg database everyday. > > Below is my script for cronjob. > > #!/bin/sh > > */usr/local/pgsql/bin/pg_dump -U ganesh --no-owner -d mq > > /backupdb/mq.dump* > > cd / > > cd /backupdb/ > > tar -czf /backupdb/mq-`date '+%d-%m-%Y'`.tar.gz -R * > > This cronjob is schedule to run everyday at 3.30am. > > The problem I am facing is the when running the cronjob it is asking > for password. If I remove *–U ganesh*, it is still prompting for > password but this time root password. > > */How do I solve this, when running the pg_dump I don’t want it to > prompt for password./* > > Regards, > > ganesh > Hi, Just add: export PGPASSWORD=mypassword to your script. Be careful - this is like leaving the key under your house key under the mat. Regards Rudi.