I am trying to tướng sync a local thư mục to tướng a remote server using a non standard port and my rsync command is as follows:

rsync -avz ~/Research/Folder1/folder2 -e "ssh -p 3345" [email protected]:/home/reusr/folder1/folder2

I am getting the following errors:

bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received ví far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.3]

and when I lập cập rsync --version I get

rsync  version 3.1.3  protocol version 31

I am not sure why the command not found or the subsequent errors are happening.

I am using OSX Maojave as my local machine and a Debian server as my remote machine.

asked May 3, 2019 at 7:05

You local rsync needs to tướng start a remote rsync from the SSH on the remote server but is unable to tướng find it since it's probably not in its path.

That's where the "command not found" error comes from (i.e. this signifies your local rsync cannot find the remote rsync executable from the SSH session on the remote machine).

You need to tướng find out the path of rsync on the remote server and make that part of your rsync parameters. The parameter you need to tướng add is:

--rsync-path=/path/to/remote/rsync

Where /path/to/remote/rsync is the location on the remote server of the rsync command. Since your remote rsync server runs on Debian, this will probably be /usr/bin/rsync

So your rsync command becomes:

rsync -avz ~/Research/Folder1/folder2 -e "ssh -p 3345" --rsync-path=/path/to/remote/rsync [email protected]:/home/reusr/folder1/folder2

answered May 3, 2019 at 7:55

Make sure rsync is also installed on the remote machine you are trying to tướng access. In my case, I was getting this error on the local machine on which it was installed, because rsync wasn’t installed on the remote server.

answered Sep 5, 2021 at 16:02

You must log in to tướng answer this question.

Not the answer you're looking for? Browse other questions tagged

.