From: Rudi Starcevic <rudi@oasis.net.au>
To: Ganesan Kanavathy <ganesh@magnusquest.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_dump.. auto backup
Date: Thu, 16 Oct 2003 12:04:57 +1000
Message-ID: <3F8DFCC9.5090603@oasis.net.au> (raw)
In-Reply-To: <000001c39385$f0491280$1300a8c0@headquarters.mq.com>
References: <000001c39385$f0491280$1300a8c0@headquarters.mq.com>
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.
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: rudi@oasis.net.au, ganesh@magnusquest.com
Subject: Re: pg_dump.. auto backup
In-Reply-To: <3F8DFCC9.5090603@oasis.net.au>
References: <000001c39385$f0491280$1300a8c0@headquarters.mq.com> <3F8DFCC9.5090603@oasis.net.au>
* 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