It contains tools that help manager server more convenient。
The tool dependence pexpect
. Pexpect is on PyPI, and can be installed with standard tools:
pip install pexpect
Or
easy_install pexpect
The tool only test on python 2.7
. Until someone use it on python 3.x, I won't test it.
speedyScp
can speed up scp
command at some special network.
In China, upload bandwidth is rare. So the upload speed will be low. For me the speed is 200KB/s.
I usually need to upload large file(50MB
) to server. And it will cost me 4~5 minutes. Life is short, I need upload faster!
Usage
-
Edit
servers.json
. Set the right info ofhost
,user
,password
.There are three type server.
- jump server
- lan server
- product server
-
Execute the script
Usage: speedyScp.py [options] arg
Options:
-h, --help show this help message and exit
-f FILENAME, --file=FILENAME
transfer the file to remote server
-c CONFIG, --config=CONFIG
the server config file
-l LAN_SERVERS, --lan-servers=LAN_SERVERS
use lan servers to speed scp,
eg:server1,server2[,server_n]
-d DEST_SERVERS, --destination-servers=DEST_SERVERS
destination that file would be upload.
eg:server1[,server_n]
TODO
-
could execute on any work directory
-
file could be full path
-
refactor dependence of login,scp,deploy
-
split file smaller that can make upload as quick as possible
-
show upload progress and transfer speed
-
support input passcode artificial when get passcode from mail failed.
-
add logger to record every action to find errors
-
exception
The passcode has sent to your mail. If not, After 20 seconds try again. Input again:
Feature
- allow use normal
scp
, and also could dispatch file to product server
autoLogin
is aimed at remove passcode.
Usage
- Set office mail account info
- Execute the script
Usage: autoLogin.py [options] arg
Options:
-h, --help show this help message and exit
-c CONFIG, --config=CONFIG
the server config file
-s NAME, --server-name=NAME
the server name set in config file. eg: tw06177