Use SSH in batch mode if hitting multiple servers
rated 0 times [ 0] [ 0] / comments: 1 / hits: 259 / 1 year ago, thu, mar 1, 2018, 15:08:49
Using batch mode and adding a timeout will help get through a long list of servers that may or may not be up.
# SSH as user root to multiple rowty.net servers.. # The list of servers host1.rowty.net host2.rowty.net host3.rowty.net # Run a command on all of them - using batchmode and timeout for m in $(cat ./rowty-servers.txt);do ssh -o BatchMode=yes -o ConnectTimeout=1 email@example.com "uptime";done
More From » general