Skip to content

ShichaoMa/exec_cmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

多线程并发执行远程主机文件复制及远程命令执行

INSTALL

ubuntu

    git clone https://github.com/ShichaoMa/exec_cmd.git
    sudo python setup.py  install

    or

    sudo pip install executecmd

START

    ubuntu@dev:~$ exec-cmd -h
    usage: execute_cmd.py [-h] {sftp,smc,ssh} ...

    ssh or sftp cmd execute.

    positional arguments:
      {sftp,smc,ssh}  Command.
        sftp          use sftp to send or receive files or floders to or from
                      remote.
        smc           simple cmd to execute.
        ssh           use ssh execute cmd in remote.

    optional arguments:
      -h, --help      show this help message and exit
    Command 'sftp'
    usage: execute_cmd.py sftp [-h] [-p] host_file

    Command 'smc'
    usage: execute_cmd.py smc [-h] --host HOST [--port PORT] -u USER -p PASSWORD
                              -c COMMAND

    Command 'ssh'
    usage: execute_cmd.py ssh [-h] [-f] [-b] host_file

DESCRIPTION

--host_file 指定配置文件 格式参见:
host_file_ssh
host_file_sftp

stfp 模式

-p 是否显示进度条

ssh 模式

-f 每个远程主机指令集是否顺序执行,或并发执行
-b 是否阻塞进程等待指令集执行完毕,并返回信息

smc 简单命令执行

--host host
--port port
-u username
-p password
-c command

About

执行远程shell 命令或者使用sftp多主机之间传递文件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages