qingjue 发表于 2022-7-10 23:37:37

【开源】远端命令工具

补充一下,如果有项目需要频繁上传文件并运行来测试的话,这种就要比shell方便很多,
shell适合做流水型命令,这个就比较适合做循环的了

此工具用于向远端服务器发送下载文件和shell命令操作,只需配置yaml文件即可
yaml文件:
server:
ip: xx.xxx.xxx.xxx
port: 22
account: root
password: xxxxxx
commands:
- ls
- ps
uploads:
-
    src: ./ksctl.yaml
    dst: /root/ksctl.yaml
-
    src: ./xxxx
    dst: /root/xxxx
downloads:
-
    src: /root/ksctl.yaml
    dst: ./ksctl.yaml
-
    src: ./xxxx
    dst: /root/xxxx
exec:
    name: /xxx/xxx
    exit: true
server为服务器配置commands命令将会依次运行,每次条指令运行后将返回结果再运行下一条命令uploads和downloads为上传和下载文件exec为想要运行的应用程序,name是绝对路径,exit代表当前程序退出时,远程程序是否退出

使用:
git clone https://github.com/hxoreyer/ksctl
go run ksctl.go -f
Release:
ksctl -f
可将二进制程序放入环境变量path中

项目地址:https://github.com/hxoreyer/ksctl
页: [1]
查看完整版本: 【开源】远端命令工具