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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

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