Last active
October 12, 2015 19:28
-
-
Save toshimaru/4076525 to your computer and use it in GitHub Desktop.
複数ホストに ssh しながら tail -F
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#refs. http://blog.64p.org/entry/2012/08/24/165701 | |
function kill_children { | |
pkill -P $$; | |
wait; | |
} | |
trap "kill_children" EXIT | |
HOSTS="192.168.1.1 192.168.1.2" | |
for host in $HOSTS | |
do | |
ssh $host tail -F /service/foo/log/main/current & | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment