Re: Backing up the database via browser

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: Backing up the database via browser
Дата
Msg-id Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com
обсуждение исходный текст
Ответ на Re: Backing up the database via browser  ("David Busby" <busby@pnts.com>)
Список pgsql-php
On Mon, 11 Nov 2002, David Busby wrote:

> Zavier,
>     Using PHP You can do a ``, shell_exec, or passthru to run another
> process, (search for the word "exec" on php.net).  Using that and PostgreSQL
> command pg_dump you can pull it off, might take a while, here's some
> untested code with no error checking
>
> <?php
> $db = $_GET['db'];
> $cmd = "pg_dump -c -D -f /tix/miner/miner.sql -F p -N -U postgres $db";
> $res = `$cmd`;
> // Alternate: $res = shell_exec($cmd);
> echo $res;
> ?>

He might need to start the $cmd with "/path/to/pg_dump...

unless the pgsql path is in httpd's path.


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

Предыдущее
От: "David Busby"
Дата:
Сообщение: Re: Backing up the database via browser
Следующее
От: Kevin Gordon
Дата:
Сообщение: Compiling Postgresql --with-unixodbc