PHP postgres backup.

Posted by russell kinch on Stack Overflow See other posts from Stack Overflow or by russell kinch
Published on 2010-03-15T06:29:13Z Indexed on 2010/03/15 6:39 UTC
Read the original article Hit count: 615

Filed under:
|
|

Hi. I am trying to make a Postgres PHP backup script. I have downloaded one for the command line which looks like this:

#!/bin/bash
find /home/russell/pg_bkp -type f -mtime +7 -exec rm {} \;
time=`date +%Y-%m-%d`; # date in reverse so that lastest date appears last in the list of backup files.
PGPASSWORD=****** pg_dump -i -h localhost -p 5432 -U postgres -F c -b -v -f "/home/russell/pg_bkp/$time.backup" ah3

How can I implement this in PHP? The extension that this creates is .backup. It works great and have used it many times. the data is perfect, but doing it from inside my website would be better. Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about postgresql