Re: Backing up the database via browser

From: "David Busby" <busby(at)pnts(dot)com>
To: "Zavier Sheran" <zsheran(at)yahoo(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Backing up the database via browser
Date: 2002-11-11 17:52:43
Message-ID: 013301c289ab$2311feb0$4000000a@busbydev
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)yahoo(dot)com>
To: <pgsql-php(at)postgresql(dot)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

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message scott.marlowe 2002-11-11 18:24:16 Re: Backing up the database via browser
Previous Message Ludwig Lim 2002-11-11 04:00:46 Re: Transaction including two web page + timer