k-trainer
v2.0.2
Published
Help you faster to complete daily operation command and upload
Downloads
4
Readme
K-Trainer
Help you faster to complete daily operation command and upload
Install
npm install -g k-trainer
Use
k-trainer -d ./ // cp demo.json to ./
k-trainer -j demo.json or k-trainer -j demo.json -g mzk
Command
k-trainer --help
Usage /usr/local/bin/k-trainer -j {json_file} -g {[group_name...]}
Options:
--json, -j config.json path [string]
--group, -g execute group, type is array|string [array] [default: []]
--demo, -d get a demo, config.json, set a path [string]
--help Show help [boolean]
API
options.data
| key | | |---------|-------------------------------------------------------------------------------------------------------------------------------| | real | boolean, default is true,The object is valid? | | path | Listening to the specified file path (recommend absolute path) | | type | ftp or shell | | execute | start or auto | | time | 1. And only when the execute for auto works 2. auto for training in rotation (minimum of 5000) 3. unit is the second time | You can now import Markdown table cod
Demo
{
"shell_concurrency": 1, //shell parallel num
"data": [
{
"real": false,
"path": "/Users/maizhikun",
"type": "ftp",
"execute": "change"
},
{
"group": "mzk",
"type": "shell",
"shell": {
"command": "echo",
"args": ["one"],
"options": {
"cwd": "/Users/maizhikun/"
}
},
"execute": "start"
},
{
"group": "mzk",
"type": "shell",
"shell": {
"command": "echo two && echo three",
"options": {
"cwd": "/Users/maizhikun/"
}
},
"execute": "auto",
"time": 3000
}
]
}
or
FTP Setting
ftp will find sftp-config.json in "path" until "/"
tips: sftp-config.json demo
FTP Requirements
if you need FTP uoload ,You need to have the executable lftp
installed on your computer.
Windows (Chocolatey)
C:\> choco install lftp
OSX (Homebrew)
sudo brew install lftp
Linux
sudo apt-get install lftp
# or
sudo yum install lftp