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 0F40DD1B4E6 for ; Thu, 16 Oct 2003 03:22:19 +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 09258-05 for ; Thu, 16 Oct 2003 00:21:48 -0300 (ADT) Received: from mqsporttec.com (evilgods.net [128.121.126.6]) by svr1.postgresql.org (Postfix) with ESMTP id C583DD1B500 for ; Thu, 16 Oct 2003 00:21:47 -0300 (ADT) Received: from ganesan ([219.93.76.2]) by mqsporttec.com (8.12.10/8.11.6) with ESMTP id h9G3LeA7053866; Thu, 16 Oct 2003 11:21:41 +0800 (MYT) From: "Ganesan Kanavathy" To: "'Rudi Starcevic'" Cc: Subject: Re: pg_dump.. auto backup Date: Thu, 16 Oct 2003 11:21:14 +0800 Message-ID: <001301c39394$92c4a6b0$1300a8c0@headquarters.mq.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <3F8DFCC9.5090603@oasis.net.au> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/166 X-Sequence-Number: 10727 Thanks Rudi, If possible I always prefer not to hard code any password in my script. Regards, ganesh -----Original Message----- From: Rudi Starcevic [mailto:rudi@oasis.net.au] Sent: Thursday, October 16, 2003 10:05 AM To: Ganesan Kanavathy Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] pg_dump.. auto backup 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.