bash - How to enter Multiple entries in .pgpass file? -


i supposed execute same psql command bash script on 5 remote machines using username , password.

i have read have pass credentials in .pgpass file , use -w option while executing psql command.

but how can execute same command on 5 machines using same .pgpass file?

you can add multiple entries in .pgpass file e.g.

syntax:

hostname:port:database:username:password 

sample file:

test.net:5432:testdb:testuser:testpass test1.net:5432:testdb1:testuser1:testpass1 test2.net:5432:testdb2:testuser2:testpass2 

make sure permission of .pgpass file set 0600

chmod 0600 .pgpass 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -