Re: pg_dump.. auto backup

From: "Ganesan Kanavathy" <ganesh(at)magnusquest(dot)com>
To: "'Rudi Starcevic'" <rudi(at)oasis(dot)net(dot)au>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_dump.. auto backup
Date: 2003-10-16 03:21:14
Message-ID: 001301c39394$92c4a6b0$1300a8c0@headquarters.mq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)oasis(dot)net(dot)au]
Sent: Thursday, October 16, 2003 10:05 AM
To: Ganesan Kanavathy
Cc: pgsql-admin(at)postgresql(dot)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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-10-16 03:36:35 Re: pg_dump.. auto backup
Previous Message Rudi Starcevic 2003-10-16 02:04:57 Re: pg_dump.. auto backup