pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Backing up the database via browser
3+ messages / 3 participants
[nested] [flat]

* Backing up the database via browser
@ 2002-11-10 15:36 Zavier Sheran <zsheran@yahoo.com>
  2002-11-11 17:52 ` Re: Backing up the database via browser David Busby <busby@pnts.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Zavier Sheran @ 2002-11-10 15:36 UTC (permalink / raw)
  To: pgsql-php

Hi all,

I'm looking for a way to create a link in a webpage
that creates a backup of the database and another link
to download the created backup file. Something similar
to what phpPgAdmin uses in the "View dump (schema) of
database" function with the "Structure and data"
option selected. I browsed the source of phpPgAdmin
but couldn't find the part where the code for that
function is...

Thanks for your help.

-Zavier

=====
---
zavier.net - Internet Solutions
---

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Backing up the database via browser
  2002-11-10 15:36 Backing up the database via browser Zavier Sheran <zsheran@yahoo.com>
@ 2002-11-11 17:52 ` David Busby <busby@pnts.com>
  2002-11-11 18:24   ` Re: Backing up the database via browser scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 1 reply; 3+ messages in thread

From: David Busby @ 2002-11-11 17:52 UTC (permalink / raw)
  To: Zavier Sheran <zsheran@yahoo.com>; +Cc: pgsql-php

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;
?>


----- Original Message -----
From: "Zavier Sheran" <zsheran@yahoo.com>
To: <pgsql-php@postgresql.org>
Sent: Sunday, November 10, 2002 07:36
Subject: [PHP] Backing up the database via browser


> Hi all,
>
> I'm looking for a way to create a link in a webpage
> that creates a backup of the database and another link
> to download the created backup file. Something similar
> to what phpPgAdmin uses in the "View dump (schema) of
> database" function with the "Structure and data"
> option selected. I browsed the source of phpPgAdmin
> but couldn't find the part where the code for that
> function is...
>
> Thanks for your help.
>
> -Zavier
>
> =====
> ---
> zavier.net - Internet Solutions
> ---
>
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Backing up the database via browser
  2002-11-10 15:36 Backing up the database via browser Zavier Sheran <zsheran@yahoo.com>
  2002-11-11 17:52 ` Re: Backing up the database via browser David Busby <busby@pnts.com>
@ 2002-11-11 18:24   ` scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 0 replies; 3+ messages in thread

From: scott.marlowe @ 2002-11-11 18:24 UTC (permalink / raw)
  To: David Busby <busby@pnts.com>; +Cc: Zavier Sheran <zsheran@yahoo.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.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-11-11 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-10 15:36 Backing up the database via browser Zavier Sheran <zsheran@yahoo.com>
2002-11-11 17:52 ` David Busby <busby@pnts.com>
2002-11-11 18:24   ` scott.marlowe <scott.marlowe@ihs.com>

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