Advertisement
Guest User

Untitled

a guest
Jun 7th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #!/bin/bash
  2. # names have been changed to protect the guilty
  3. cred="user=dbadmin password=SECRET"
  4. domain=example.com
  5.  
  6. tee
  7. >( psql -X "host=db1.$domain dbname=db1 $cred" )
  8. >( psql -X "host=db2.$domain dbname=db2 $cred" )
  9. >( psql -X "host=db3.$domain dbname=db3 $cred" )
  10. >( psql -X "host=xdb1.$domain dbname=xdb1 $cred" )
  11. > /dev/null
  12. wait
  13.  
  14. tee "${p[@]}" > /dev/null
  15.  
  16. tee: /dev/fd/63: No such file or directory
  17.  
  18. p=()
  19. for z in db1 db2 db3 xdb1
  20. do
  21. p+=( >( psql -X "host=$z.$domain dbname=$z $cred" ) )
  22. done
  23. tee "${p[@]}" > /dev/null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement