Sync data from linux to max
I used use the tool lsyncd to sync data between linux server, these days I want to sync data from linux to mac, and when start the lsyncd…
I used use the tool lsyncd
to sync data between linux server, these days I want to sync data from linux to mac, and when start the lsyncd
service, it failed with the following error:lsyncd[26220]: rsync: on remote machine: -svlogDtprze.iLsfxC: unknown optionlsyncd[26220]: rsync error: syntax or usage error (code 1) at /System/Volumes/Data/SWE/macOS/BuildRoots/533514bb11/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(1337) [server=2.6.9]lsyncd[26220]: rsync: connection unexpectedly closed (0 bytes received so far) [sender]lsyncd[26220]: rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2]
From the log, it says that the rsync
version on my mac is 2.6.9
, but on the linux server, the version is 3.1.2
, so I install a new rsync
version on mac machine with brew
, but it still failed. Also I set the path on .zprofile
, but the when use lsync
tool, it still use the default rsync
version. And i find that the rsync used /usr/bin/rsync
, I try to rename the original rsync
and make a link to the new version of rsync
, but It report the following error:mv: rename rsync to rsync.0: Operation not permitted
Find why the lsyncd
service use the rsync on /usr/bin/rsync
, use the ssh command to test the rsync
command.// Show the rsync version
ssh <user>@<host> 'rsync --version'// Show the current path
ssh <user>@<host> 'echo $PATH'
Added brew path on .zshenv
to solve the problem.
I try to add brew path to .zprofile
and .zshrc
both solution can’t solve the problem, and finally find after add the path on .zshenv
can solve the problem.
I find the order of the environment files from ZSH: .zprofile, .zshrc, .zlogin — What goes where? are as below:
.zshenv
→ .zprofile
→ .zshrc
→ .zlogin
→ .zlogout
Resources