-- install : -- lsyncd for osx -- local dir -> ssh -- brew install lsyncd -- brew install rsync ; /usr/local/bin/rsync instead of local rsync -- start up : sudo lsyncd ~/a.config -- file ~/a.config settings { logfile ="/var/log/lysncd/lsyncd.log", statusFile ="/var/log/lysncd/lsyncd.status", inotifyMode = "CloseWrite", maxProcesses = 7, -- nodaemon =true, } sync { default.rsync, source = "/data1/htdocs/fanxing.kugou.git/", target = "www@10.16.6.91:/data1/htdocs/kfwlf.kugou.com/", exclude = {"/data1/htdocs/fanxing.kugou.git/.git"}, -- excludeFrom = "/etc/rsyncd.d/rsync_exclude.lst", maxDelays = 1, delay = 3, delete = true, -- init = true, rsync = { binary = "/usr/local/bin/rsync", archive = true, compress = true, bwlimit = 2000, rsh = "/usr/bin/ssh -l www -i /Users/mmfei/.ssh/id_rsa -p 32200 -o StrictHostKeyChecking=no" -- 如果要指定其它端口,请用上面的rsh } }