Re: Backing up the database via browser - Mailing list pgsql-php

From scott.marlowe
Subject Re: Backing up the database via browser
Date
Msg-id Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com
Whole thread Raw
In response to Re: Backing up the database via browser  ("David Busby" <busby@pnts.com>)
List 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 by date:

Previous
From: "David Busby"
Date:
Subject: Re: Backing up the database via browser
Next
From: Kevin Gordon
Date:
Subject: Compiling Postgresql --with-unixodbc