【文件属性】:
文件名称:Linux下批量执行,批量上传脚本
文件大小:2KB
文件格式:RAR
更新时间:2020-11-09 08:13:11
批量执行 批量上传
运行环境:主信任服务器
Ps:可使用TeamRemote.exe工具批量建信任
将服务器ip写在文件中,例如host.txt
192.168.1.21
192.168.1.22
192.168.1.23
192.168.1.24
192.168.1.25
...
执行命令
./remote.sh [-f hostlist] [-b threadnum] [-c cmd]
[-f ip配置文件]
[-b 进程数]
[-c 命令]
例如 对各台服务器执行uptime和df -h命令
./remote.sh -f host.txt -c "uptime;df -h" # 1个进程
./remote.sh -f host.txt -c "uptime;df -h" -b10 # 10个进程并发
文件传输
./remote.sh [-f hostlist] [-s file1 file2 dir1 dir2...] [-r dstdir]"
[-f ip配置文件]
[-s 本地文件或目录]
[-r 远程接收目录]
例如 将/tmp目录下的1.txt、dir1、dir2发送到各台服务器的/home目录下
./remote.sh -f host.txt -s /tmp/1.txt /tmp/dir1/ /tmp/dir2/ -r /home/
【文件预览】:
remote.sh
remote.sh使用说明.txt