2

I am trying to sync a local folder to a remote server using a non standard port and my rsync command is as follows:

rsync -avz ~/Research/Folder1/folder2 -e "ssh -p 3345" reusr@yyy.xxx.xx.xxx:/home/reusr/folder1/folder2

I am getting the following errors:

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

and when I run 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.

6

You local rsync needs to start a remote rsync from the SSH on the remote server but is unable to 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 find out the path of rsync on the remote server and make that part of your rsync parameters. The parameter you need to 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 reusr@yyy.xxx.xx.xxx:/home/reusr/folder1/folder2
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.