Reputation: 36879
I'm busy backing up my postgres db, I run the following command
pg_dump -d data -U postgres -h 127.0.0.1 -CdiOv > data.sql
I however have one problem I get asked for the password, if I want to add this into a cron I do not want to get promted for the password. Is there any way to do this without the password prompt?
Upvotes: 0
Views: 421
Reputation:
First of all: never use -d option to pg_dump. Do you even know what it does?
Second: use pgpass file or PGPASSWORD env variable.
Upvotes: 1
Reputation: 13763
Use ~/.pgpass. pgpass documentation
Lots more details to be found on Google, searching for "pg_dump password".
Upvotes: 1