在工做中往往会在本地编辑/编译文件,然后上传到远程服务器上, 往往这个操作又频繁乏味浪费时间,于是我写了个工具, 检测本地文件的变化, 自动同步到远程服务器, 其实也非常简单, 使用notify和rsync来完成, notify监控文件变化, rsync上传.
手打ip很累
- ssh登录使用了~/.ssh/conf里的配置的
Host
名字, 无需额外配置 - 根据规则映射ip, 你可以自己更改, 对于我自己而言:
q123 -> 192.168.1.123
20 -> 10.10.20.20
30.20 -> 10.10.30.20
other_dns -> other_dns
- 可以直接使用
/etc/hosts
中的设置
手打密码也很累
可以在配置文件中设置全局密码和全局ssh_key
配置文件
global_user = "root"
global_key = "~/.ssh/id_rsa"
#global_password = "test"
[[projects]]
name = "default"
src = "~/Desktop/default/"
dest = "~/default/"
exclude = [
".git",
".idea",
".vscode",
"test",
]
[[projects]]
name = "test"
src = "~/Desktop/test/"
dest = "~/test/"
exclude = [
".git",
".idea",
".vscode",
]
使用
USAGE:
rn [FLAGS] [OPTIONS] <server>
FLAGS:
-h, --help Prints help information
-v see detail information
-V, --version Prints version information
-w, --watch keep watching for file change!
OPTIONS:
-c, --config <config> Config for rn's variables. [default: ~/bin/settings.toml]
-i, --indentity <identity> set ssh identity file path for remote host.
--log <log> set log path
--password <password> set ssh password for remote host.
--port <port> set ssh port for remote host.
-p, --project <PROJECT> set the project name to be deployed! [default: default]
--user <user> set ssh username for remote host.
ARGS:
<server> set the remote server name which comes from ~/.ssh/config or inner rule.
github地址有具体的使用方法和例子, 好用的话, 给个star
1
共 2 条评论, 1 页
评论区
写评论多谢
已star