From: | "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com> |
---|---|
To: | David Busby <busby(at)pnts(dot)com> |
Cc: | Zavier Sheran <zsheran(at)yahoo(dot)com>, <pgsql-php(at)postgresql(dot)org> |
Subject: | Re: Backing up the database via browser |
Date: | 2002-11-11 18:24:16 |
Message-ID: | Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Papp Gyozo | 2002-11-11 23:38:56 | Re: Are these steps correct and standard way to upload |
Previous Message | David Busby | 2002-11-11 17:52:43 | Re: Backing up the database via browser |