Why is this rsync connection unexpectedly closed on Windows? [closed]
The trick for me was I had ssh
conflict.
I have Git installed on my Windows path, which includes ssh. cwrsync also installs ssh.
The trick is to have make a batch file to set the correct paths:
rsync.bat
@echo off
SETLOCAL
SET CWRSYNCHOME=c:\commands\cwrsync
SET HOME=c:\Users\Petah\
SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%\bin;%PATH%
%~dp0\cwrsync\bin\rsync.exe %*
On Windows you can type where ssh
to check if this is an issue. You will get something like this:
where ssh
C:\Program Files (x86)\Git\bin\ssh.exe
C:\Program Files\cwRsync\ssh.exe
I saw this when changing rsync versions. In the older version, it worked to say:
rsync -e 'ssh ...
when the rsync.exe
and ssh.exe
were in the same directory.
With the newer version, I had to specify the path:
rsync -e './ssh ...
and it worked.
I had this problem, but only when I tried to rsync from a Linux (RH) server to a Solaris server. My fix was to make sure rsync had the same path on both boxes, and that the ownership of rsync was the same.
On the linux box, rsync path was /usr/bin, on Solaris box it was /usr/local/bin. So, on the Solaris box I did ln -s /usr/local/bin/rsync /usr/bin/rsync.
I still had the same problem, and noticed ownership differences. On linux it was root:root, on solaris it was bin:bin. Changing solaris to root:root fixed it.
I had this error coming up between 2 Linux boxes. Easily solved by installing RSYNC on the remote box as well as the local one.