Re: redirecting output of pg_dump

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: redirecting output of pg_dump
Дата
Msg-id 20070718103204.GE17772@a-kretschmer.de
обсуждение исходный текст
Ответ на redirecting output of pg_dump  ("Ashish Karalkar" <ashish.karalkar@info-spectrum.com>)
Список pgsql-general
am  Wed, dem 18.07.2007, um 15:39:01 +0530 mailte Ashish Karalkar folgendes:
> Hello all,
>
> I want to take backup from one server and save it to another machine hard
> drive.
> The backup will be taken through a shell script attached to  a cron job.
>
> something like:
>
> pg_dump -d postgres -U postgres -f <IP address of other machine and path to
> save the file on that machine >
>
> is there any way?

Yes, any. For instance:

- you are on the remote machine (which should store the backup)
  ssh remote "pg_dump ..." > backup.sql

- you have the pg_dump installed on the backup-machine:
  pg_dump -h remote ... > backup.sql

- you are on the server:
  pg_dump ... | ssh backup_server "cat - > backup.sql"


(all untested, but should work)

Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

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

Предыдущее
От: Joshua N Pritikin
Дата:
Сообщение: Re: redirecting output of pg_dump
Следующее
От: Sim Zacks
Дата:
Сообщение: Re: unconvertable characters