Re: Pg_dump options

Поиск
Список
Период
Сортировка
От Devrim GUNDUZ
Тема Re: Pg_dump options
Дата
Msg-id Pine.LNX.4.44.0201300937070.23571-100000@oper.metu.edu.tr
обсуждение исходный текст
Ответ на Pg_dump options  (Troy.Campano@LibertyMutual.com)
Список pgsql-general
Hi,

YOu could do it by using expect:
Here is a sample code:

---------------
1. backup.sh

    #!/usr/bin/expect -f
    set env(SHELL) /bin/sh
    set env(HOME) /usr/sbin/

    spawn /usr/sbin/createdbbackups.sh

    expect Username:
    send postgres\r
    expect Password:
    send YourPasswdHere\r

2.createdbbackups.sh

    pg_dump mydb > mydb.pgdump -p 5456 -u;

---------------

If you are having a backup for more than one database, you should write
their names in the second file, and write the last four lines in the first
file (beginning with expect, ending with the passwd line) as many as the
number of your databases.

Regards and best wishes,

--

Devrim GÜNDÜZ

devrim@oper.metu.edu.tr
devrim.gunduz@linux.org.tr
devrimg@tr.net

Phone : +90-535-328-9594 (cellular)-
Phone : +90-312-295-9595 (work)
Phone : +90-312-286-5906 (home)

Web : http://devrim.oper.metu.edu.tr
------------------------------------------------------------------

On Mon, 28 Jan 2002 Troy.Campano@LibertyMutual.com wrote:

> Is there a way to supply a username and password in one command using
> pg_dump?
>
>
> For example is it possible to do this so it doesn't prompt you for a
> username/password:
>
>
>
> pg_dump mydb --username=dbuser --password=dbpass > myfile.out
>
>
>
> Thank you!
>
> [:==> Troy Campano <==:]
>
>





В списке pgsql-general по дате отправления:

Предыдущее
От: "Ben-Nes Michael"
Дата:
Сообщение: Re: Upgrade 7.0.3 -> 7.1.3 problems!
Следующее
От: Ben-Nes Michael
Дата:
Сообщение: Re: unique & update