File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,31 @@ To install gevent you need the libevent-dev package installed. Instructions belo
1818 $ sudo apt-get install libevent-dev
1919 $ pip install parallel-ssh
2020
21- ************
21+ *************
2222Usage Example
23- ************
23+ *************
2424
2525>>> from pssh import ParallelSSHClient
2626>>> hosts = [' myhost1' , ' myhost2' ]
2727>>> client = ParallelSSHClient(hosts)
2828>>> cmds = client.exec_command(' ls -ltrh /tmp/aasdfasdf' , sudo = True )
2929>>> print [client.get_stdout(cmd) for cmd in cmds]
30+ [localhost] drwxr-xr-x 6 xxx xxx 4.0K Jan 1 00:00 xxx
31+ [{'localhost': {'exit_code': 0}}]
32+
33+
34+ ************
35+ SFTP support
36+ ************
37+
38+ SFTP is supported (scp version 2 protocol) natively, no scp command used.
39+
40+ For example to copy a local file to remote hosts in parallel
41+
42+ >>> from pssh import ParallelSSHClient
43+ >>> hosts = [' myhost1' , ' myhost2' ]
44+ >>> client = ParallelSSHClient(hosts)
45+ >>> cmds = client.copy_file(' ../test' , ' test_dir/test' )
46+ >>> client.pool.join()
47+ `Copied local file ../test to remote destination localhost:test_dir/test`
48+
You can’t perform that action at this time.
0 commit comments