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
Post a Comment