多主機下同一命令 - Linux
By Frederic
at 2010-02-10T21:45
at 2010-02-10T21:45
Table of Contents
多主機下同一命令
有一強者寫了個叫 dssh 的shell script
http://bashcurescancer.com/dssh-executing-an-arbitrary-command-in-parallel-on-an-arb
itrary-number-of-hosts.html
不過我認為下面這樣比較簡單
缺點是不能有其它參數,等我會寫之後再改進好了
------------------- 指令
list='virtue@::1 [email protected]'
dssh(){ for i in $list;do echo $i\:;ssh $i $1;done;}
dssh uptime
------------------- 結果
virtue@::1:
21:33:43 up 23:03, 0 users, load average: 0.54, 0.42, 0.64
[email protected]:
9:36PM up 8 days, 8:58, 0 users, load averages: 2.00, 2.02, 2.00
--
Tags:
Linux
All Comments
By Sarah
at 2010-02-15T07:06
at 2010-02-15T07:06
By Mary
at 2010-02-19T21:57
at 2010-02-19T21:57
Related Posts
掛載硬碟權限
By Tristan Cohan
at 2010-02-10T20:54
at 2010-02-10T20:54
debian 的 unstable/testing/stable
By Agnes
at 2010-02-10T19:31
at 2010-02-10T19:31
請問Ubuntu與CIC軟體的支援度
By Margaret
at 2010-02-10T19:27
at 2010-02-10T19:27
debian 的 unstable/testing/stable
By Aaliyah
at 2010-02-10T19:22
at 2010-02-10T19:22
ifconfig tun0 down 無效?
By Emma
at 2010-02-10T15:41
at 2010-02-10T15:41