本地与服务端保持随时同步问题
- 问题描述
在服务端开发时,我们需要把本地开发的代码发布到服务端,尤其是在使用lua这种脚本时,实时的同步lua代码变得尤为重要
- 解决方案
今天介绍的方案是使用
nobone-sync
这个工具来实现
- 服务端安装
- nodejs安装
- npm install -g nobone-sync
- 配置文件sync-config.js
module.exports = {
rootAllowed: '/home/sync',
host: '127.0.0.1',
port: 8099,
pattern: '**',
password: 'test',
algorithm: 'aes128',
onChange: function(type, path, oldPath){}
};
- 启动
nobone-sync -s sync-config.js
- 客户端安装
- nodejs安装
- npm install -g nobone-sync
- 配置文件sync-config.js
module.exports = {
localDir: 'h:\\sync\\test\\',
remoteDir: '/home/sync/test/',
host: '服务器地址',
port: 8099,
pattern: '**',
password: 'test',
pollingInterval: 800
};
- 启动
nobone-sync sync-config.js
- 最后的效果
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步