pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: David Busby <busby@pnts.com>
Cc: Zavier Sheran <zsheran@yahoo.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Backing up the database via browser
Date: Mon, 11 Nov 2002 11:24:16 -0700 (MST)
Message-ID: <Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com> (raw)
In-Reply-To: <013301c289ab$2311feb0$4000000a@busbydev>

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.




view thread (3+ messages)

Message-ID: <Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: scott.marlowe@ihs.com, busby@pnts.com, zsheran@yahoo.com
  Subject: Re: Backing up the database via browser
  In-Reply-To: <Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com>
  References: <013301c289ab$2311feb0$4000000a@busbydev> <Pine.LNX.4.33.0211111123290.22991-100000@css120.ihs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox