Automating Postgres Backups

I am trying to work with the Postgres backup script

I am using Postgres 9.1 on a remote Ubuntu 12.04 LTS server.

Everything seems to be working but when I run the script, I have to put the passwords in manually.

I have created a .pgpass file and made sure to set the permissions to 0600 however, the script is still prompting me to manually enter my password.

My .pgpass file looks like:


Not sure, but I think part of the problem is that I did not set up a user ‘backup_user’ in linux.

I placed the .pgpass file in multiple locations with no luck:

~/ /etc/postgresql/ /etc/postgresql/9.1/ /etc/postgresql/9.1/main/

Any ideas on what is tripping this up?