Обсуждение: pg_dump question

Поиск
Список
Период
Сортировка

pg_dump question

От
"Tom Haddon"
Дата:
Hi Folks,

Fairly basic question here, I think. I've looked through the archives, but
can't seem to find anything.

I need to set up a daily cron job that performs a pg_dump on a remote
database. I can't figure out how to pass a password to it. How do I do
this. Everything I've tried still comes up with asking me for a password
when I test it.

Thanks, Tom



Re: pg_dump question

От
Aaron Spiteri
Дата:
One way is to do this is by configuring the remote server to trust the host
that is going to be doing the back up.  This can be done in the pg_hba.conf
file which is located in "/var/lib/pgsql/data" on my server.

If the Server that is going to be doing the back up has the IP address of say
192.168.0.2 and then on the database server you can add the following lines

host     all    192.168.0.2    255.255.255.255        trust
host    all    0.0.0.0    255.255.255.255    password

This will allow the server 192.168.0.2 to access any database it likes
remotly without needing a password.  Usename must be valid however.

This can also specify what database the host can access by changing the
key word "all" to the database name.
host     template1    192.168.0.2    255.255.255.255        trust

There are possibly much more secure wats to do this and if you here of any
let me know.

Aaron

On Tue, 29 Oct 2002 12:26, you wrote:
> Hi Folks,
>
> Fairly basic question here, I think. I've looked through the archives, but
> can't seem to find anything.
>
> I need to set up a daily cron job that performs a pg_dump on a remote
> database. I can't figure out how to pass a password to it. How do I do
> this. Everything I've tried still comes up with asking me for a password
> when I test it.
>
> Thanks, Tom
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: pg_dump question

От
Bhuvan A
Дата:
> I need to set up a daily cron job that performs a pg_dump on a remote
> database. I can't figure out how to pass a password to it. How do I do
> this. Everything I've tried still comes up with asking me for a password
> when I test it.
>

$ export PGPASSWORD=user_pass
$ echo -e "Would do the trick. Yes, it will not ask for the password
again";

regards,
bhuvaneswaran