pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ganesan Kanavathy <ganesh@magnusquest.com>
To: 'Rudi Starcevic' <rudi@oasis.net.au>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_dump.. auto backup
Date: Thu, 16 Oct 2003 11:21:14 +0800
Message-ID: <001301c39394$92c4a6b0$1300a8c0@headquarters.mq.com> (raw)
In-Reply-To: <3F8DFCC9.5090603@oasis.net.au>

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.





view thread (6+ messages)  latest in thread

Message-ID: <001301c39394$92c4a6b0$1300a8c0@headquarters.mq.com>
Permalink:  ../001301c39394$92c4a6b0$1300a8c0@headquarters.mq.com/
Also on:    postgresql.org/message-id/001301c39394$92c4a6b0$1300a8c0@headquarters.mq.com

 · 

reply

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: ganesh@magnusquest.com, rudi@oasis.net.au
  Subject: Re: pg_dump.. auto backup
  In-Reply-To: <001301c39394$92c4a6b0$1300a8c0@headquarters.mq.com>
  References: <3F8DFCC9.5090603@oasis.net.au> <001301c39394$92c4a6b0$1300a8c0@headquarters.mq.com>

* 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