效率工具(fswatch,rsync)

Posted yaoyaohust

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了效率工具(fswatch,rsync)相关的知识,希望对你有一定的参考价值。

mac 安装 brew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 
brew install fswatch
 
% cat fswatch_code.sh
#scp -i mengmai.pem -r /Users/yao.yao/Downloads/repos/ [email protected]:/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} [email protected]:/mnt/yaoyao/repos/${relative_path}

echo `date` "rsync code done:" ${file_path}
 
运行:
nohup sh fswatch_code.sh > fswatch.out &








以上是关于效率工具(fswatch,rsync)的主要内容,如果未能解决你的问题,请参考以下文章

实时备份工具之inotify+rsync

实时备份工具之inotify+rsync

rsync备份服务

CentOS7配置rsync实现文件同步

效率高到爆炸的IT运维软件您安装了吗?

rsync+inotify-tools实时同步