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