Polysh实现多服务器批量执行shell
安装
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的更多相关文章
- Python 实现远程服务器批量执行命令
paramiko 远程控制介绍 Python paramiko是一个相当好用的远程登录模块,采用ssh协议,可以实现linux服务器的ssh远程登录.首先来看一个简单的例子 import parami ...
- linux下远程服务器批量执行命令及SFTP上传文件 -- python实现
之前写过一个python远程执行命令的脚本,但在一个性能测试中,要将程序批量分发到不同服务器,程序无法使用,再将之前的脚本更新,加入批量上传的功能.之前脚本地址:http://www.cnblogs. ...
- 在PHP中调用php_ssh实现远程登陆linux服务器并执行shell脚本。
这个功能主要用于在web端利用程序对远程服务器进行操作,通过PHP_ssh执行shell脚本来实现. 首先要安装php_ssh2组件,linux中centos7下有ssh2源,直接安装.window下 ...
- 【shell脚本】通过遍历文件的一种批量执行shell命令的方法。
在分析数据时,经常会有许多机械重复的命令带入,作为一个半路出家的程序猿,我曾经对这种工作束手无策.不像一个熟手那样举重若轻的分析,感觉自己的生信分析完全是个体力活.为了打开这样的局面,我开始学习如何批 ...
- python批量执行shell命令
[root@master ~]# cat a.py #!/usr/bin/python # -*- coding:UTF- -*- import subprocess def fun(): subpr ...
- 【Shell实战】批量在多台服务器上执行命令
功能说明:批量在多台服务器上执行命令 #!/bin/bash # ========================================== # 功能:批量在多台服务器上执行命令 # 方法: ...
- linux服务器批量部署应用系统shell脚本(Tomcat/jetty)
linux服务器批量部署应用系统shell脚本: 1.请更换代码内的服务器地址(Tomcat或jetty服务器) serverRoot=/home/undoner/java_tool/apache-t ...
- shell调用sqlplus批量执行sql文件
在最近的工作中,经常需要批量执行一些DML, DDL, PL/SQL语句或导入一些Function, Procedure.因为support的国家比较多,常常需要一个登陆到一个国家的数据库上执行完成后 ...
- 批量执行 sql 的 shell 脚本
最近有用到需要批量导入N个表的sql,一个个导入会吐老血的,写了个shell脚本,便捷导入. 通常我们导入单个sql,可以用 $mysql -uroot -p world < xxxx.sql ...
随机推荐
- 七. jenkins部署springboot项目(4)-linux环境--远程调试
前提:linux环境,jenkins服务器和springboot服务器不在一台机器. linux环境,jenkins这里就不说了,主要说下和windows环境的不同. 1. jenkins服务器连接s ...
- spring controller使用了@ResponseBody却返回xml
使用ajax请求数据 $.ajax({ url:message.rootPath +"/sendMessage.xhtml", type:"post", dat ...
- MySQL 添加用户、删除用户与授权
mysql -uroot -proot MySQL5.7 mysql.user表没有password字段改 authentication_string: 一. 创建用户: 命令:CREATE USER ...
- python3项目打包成exe可执行程序
使用pyinstaller将python文件打包成exe程序,打包步骤如下: 一.安装pyinstaller (1)win+R输入cmd,打开命令窗口 (2)安装pyinstaller,安装指令:pi ...
- Centos7安装gearman和php扩展
Centos7安装gearman和php扩展 标签(空格分隔): php,linux gearman所需要的依赖 yum install \ vim \ git \ gcc \ gcc-c++ \ w ...
- 微信小程序发送红包功能。填坑记录
微信官方文档 1.开通条件 (1)商户号已入驻90日 (2)商户号有连续30天正常交易 (3)只有企业资质的商户才有资格申请 2.注意事项 (1)目前小程序红包仅支持用户微信扫码打开小程序 (2)小程 ...
- LR 场景设置
LR 场景设置group:多个脚本按照独立设置模式跑,各个脚本可以单独设置虚拟用户.运行时间scenario:多个脚本之间按照相同模式跑,将总的虚拟用户数按照一定比例分配给各个脚本 schedule ...
- python上播放mp3歌曲
我想从python播放我的歌曲(mp3),你能给我一个最简单的命令吗? 这不正确: import wave w = wave.open("e:/LOCAL/Betrayer/Metalik ...
- Dijkstra的优先队列
模板 #include<iostream> #include<cstring> #include<algorithm> #include<cmath> ...
- 调试Xamarin.Android时出现缺少"Mono.Posix 2.0.0"的错误
1.在http://originaldll.com/file/mono.posix.dll/31191.html中下载mono.posix 2.0.0 dll 2.以管理员权限运行Visual Stu ...