您的位置:首页 > 其它

fswatch rsync配置使用 实现远程与本地同步

2016-05-03 10:58 786 查看
贴一个脚本这个脚本是rsync远程同步使用的一个脚本

rsync -avz --progress --exclude .git /Users/piperck/Desktop/gogogo/x piperck@:/home/piperck/project


在mac下配合fswatch使用可以达到监控文件变化,然后进行远程同步的目的。

fswatch -o /Users/piperck/Desktop/gogogo/x  | xargs -0 -n 1 -I {} rsync -avz --progress --exclude .git /Users/piperck/Desktop/gogogo/x piperck@ip:/home/piperck/project


reference:
https://github.com/emcrisostomo/fswatch/wiki/How-to-Use-fswatch fswatch tutorial
https://segmentfault.com/a/1190000005053788 ->hello fswatch
http://os.51cto.com/art/201006/203217.htm -> rsync命令全解
http://c.biancheng.net/cpp/view/2739.html -> Shell特殊变量:shell $0,$#,$*,$@,$?,$$和命令行参数
http://suren1986.in/?tag=fswatch -> 监听fsevents事件自动同步文件夹
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: