概述
mac 安装 brew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装 fswatch:(参考
https://stackoverflow.com/questions/1515730/is-there-a-command-like-watch-or-inotifywait-on-the-mac)
brew install fswatch
% cat fswatch_code.sh
#scp -i mengmai.pem -r /Users/yao.yao/Downloads/repos/
hadoop@ec2-13-233-83-154.ap-south-1.compute.amazonaws.com:/mnt/yaoyao/repos/
file_path=$1
relative_path=${file_path:31} # len('/Users/yao.yao/Downloads/repos/')=31
echo `date` "rsync code:" ${file_path}
# remote
rsync -ru -e "ssh -i mengmai.pem" /Users/yao.yao/Downloads/repos/${relative_path} hadoop@ec2-13-233-83-154.ap-south-1.compute.amazonaws.com:/mnt/yaoyao/repos/${relative_path}
echo `date` "rsync code done:" ${file_path}
file_path=$1
relative_path=${file_path:31} # len('/Users/yao.yao/Downloads/repos/')=31
echo `date` "rsync code:" ${file_path}
# remote
rsync -ru -e "ssh -i mengmai.pem" /Users/yao.yao/Downloads/repos/${relative_path} hadoop@ec2-13-233-83-154.ap-south-1.compute.amazonaws.com:/mnt/yaoyao/repos/${relative_path}
echo `date` "rsync code done:" ${file_path}
运行:
nohup sh fswatch_code.sh > fswatch.out &
转载于:https://www.cnblogs.com/yaoyaohust/p/10363162.html
最后
以上就是专注可乐为你收集整理的效率工具(fswatch,rsync)的全部内容,希望文章能够帮你解决效率工具(fswatch,rsync)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复