安装

wget wget http://guichaz.free.fr/polysh/files/polysh-0.4.tar.gz
tar -zxvf polysh-0.4.tar.gz
cd polysh-0.4
python setup.py install

目录/usr/bin/polysh
示例

polysh –user=root –hosts-file=ip.txt –password=p.txt
#配置好主机地址ip.txt 不想输密码也可以提前配置公共key免密码登陆
#登陆成功后即可批量执行命令

语法结构
Usage: /usr/bin/polysh [OPTIONS] HOSTS…
Control commands are prefixed by “:”. Use :help for the list

Options:

  • –version show program’s version number and exit
  • -h, –help show this help message and exit
  • –hosts-file=FILE read hostnames from given file, one per line
  • –command=CMD command to execute on the remote shells
  • –ssh=SSH ssh command to use [exec ssh -oLogLevel=Quiet -t
  • %(host)s exec bash –noprofile]
  • –user=USER remote user to log in as
  • –no-color disable colored hostnames [enabled]
  • –password-file=FILE read a password from the specified file. – is the tty.
  • –log-file=LOG_FILE file to log each machine conversation [none]
  • –abort-errors abort if some shell fails to initialize [ignore]
  • –debug print debugging information

Polysh实现多服务器批量执行shell的更多相关文章

  1. Python 实现远程服务器批量执行命令

    paramiko 远程控制介绍 Python paramiko是一个相当好用的远程登录模块,采用ssh协议,可以实现linux服务器的ssh远程登录.首先来看一个简单的例子 import parami ...

  2. linux下远程服务器批量执行命令及SFTP上传文件 -- python实现

    之前写过一个python远程执行命令的脚本,但在一个性能测试中,要将程序批量分发到不同服务器,程序无法使用,再将之前的脚本更新,加入批量上传的功能.之前脚本地址:http://www.cnblogs. ...

  3. 在PHP中调用php_ssh实现远程登陆linux服务器并执行shell脚本。

    这个功能主要用于在web端利用程序对远程服务器进行操作,通过PHP_ssh执行shell脚本来实现. 首先要安装php_ssh2组件,linux中centos7下有ssh2源,直接安装.window下 ...

  4. 【shell脚本】通过遍历文件的一种批量执行shell命令的方法。

    在分析数据时,经常会有许多机械重复的命令带入,作为一个半路出家的程序猿,我曾经对这种工作束手无策.不像一个熟手那样举重若轻的分析,感觉自己的生信分析完全是个体力活.为了打开这样的局面,我开始学习如何批 ...

  5. python批量执行shell命令

    [root@master ~]# cat a.py #!/usr/bin/python # -*- coding:UTF- -*- import subprocess def fun(): subpr ...

  6. 【Shell实战】批量在多台服务器上执行命令

    功能说明:批量在多台服务器上执行命令 #!/bin/bash # ========================================== # 功能:批量在多台服务器上执行命令 # 方法: ...

  7. linux服务器批量部署应用系统shell脚本(Tomcat/jetty)

    linux服务器批量部署应用系统shell脚本: 1.请更换代码内的服务器地址(Tomcat或jetty服务器) serverRoot=/home/undoner/java_tool/apache-t ...

  8. shell调用sqlplus批量执行sql文件

    在最近的工作中,经常需要批量执行一些DML, DDL, PL/SQL语句或导入一些Function, Procedure.因为support的国家比较多,常常需要一个登陆到一个国家的数据库上执行完成后 ...

  9. 批量执行 sql 的 shell 脚本

    最近有用到需要批量导入N个表的sql,一个个导入会吐老血的,写了个shell脚本,便捷导入. 通常我们导入单个sql,可以用 $mysql -uroot -p world < xxxx.sql ...

随机推荐

  1. MySQL &lt; &gt; 等用法

  2. 返回闭包不能引用循环变量,请改写count()函数,让它正确返回能计算1x1、2x2、3x3的函数。

    错误写法: 正确写法:

  3. 搜索的应用--计算最优解:Aizu - ALDS1_4_D Allocation

    搜索的应用-计算最优解 题目: You are given nn packages of wiwi kg from a belt conveyor in order (i=0,1,...n−1i=0, ...

  4. cesium加载gltf模型

    cesium加载gltf模型 一.采用vue-cesium:在项目里加载依赖包.命令如下: npm i --save vue-cesium 在main.js中加入如下代码: https://www.n ...

  5. Fiddler设置展示接口响应时间

    在Tool bar上面找到Rules->CustomRules 在class Handlers{   里面添加 function BeginRequestTime(oS: Session){  ...

  6. C++中的类与封装

    1,类的组合: 1,类不是孤立存在的,类之间都会有一些关系,组合就是类的基本关系之一: 2,电脑一般而言是由 CPU.内存.主板.键盘和硬盘等部件组合而成: 3,学习电脑组装需要多少时间?学习电脑组装 ...

  7. ftrace 使用方法

    1. 追蹤Kernel function (以schedule()示範) 先至 /sys/kernel/debug/tracing# cat available_tracers 確定有無 函式追蹤器( ...

  8. 2018-2-22-在-windows-安装-Jekyll

    title author date CreateTime categories 在 windows 安装 Jekyll lindexi 2018-02-22 17:47:39 +0800 2018-2 ...

  9. org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query

    原因: 这个问题的解决方案很简单,主要是因为数据库中不存在相关的表或者列. org.springframework.dao.InvalidDataAccessApiUsageException: Pa ...

  10. MYSQL全文索引—CONTAINS语法

    我们通常在 WHERE 子句中使用 CONTAINS ,就象这样:SELECT * FROM table_name WHERE CONTAINS(fullText_column,'search con ...