I have the following situation.
I have a PHP script that imports a CSV file and then updates the postgres database
Now I need to back up the database before the import happens.
PHP files run on one server and postgres database on another server
I tried exec(pg_dump db_name -CdiOv > /tmp/db_name_backup.sql), but I don't think this will work, since db is on a different server.
I'm not sure how to do this, I can make the correct PHP code by backing up, but that means it starts up.
Any hangover will be appreciated.
source
share