直接在命令行上批量执行命令

[root@node110 fabric]# fab -p 123456 -H 192.168.2.120,192.168.2.121 -- 'uname -s'
[192.168.2.120] Executing task '<remainder>'
[192.168.2.120] run: uname -s
[192.168.2.120] out: Linux
[192.168.2.120] out: 




[root@node110 fabric]# fab -p 123456 -H 192.168.2.120,192.168.2.121 -- 'uname -a'
[192.168.2.120] Executing task '<remainder>'
[192.168.2.120] run: uname -a
[192.168.2.120] out: Linux node120 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[192.168.2.120] out: 


[192.168.2.121] Executing task '<remainder>'
[192.168.2.121] run: uname -a
[192.168.2.121] out: Linux node121 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[192.168.2.121] out: 




Done.
Disconnecting from 192.168.2.121... done.
Disconnecting from 192.168.2.120... done.

分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS