Rsync for Windows

I really needed rsync for Windows, but I didn’t want to bother with installing cygwin, because it is cubersome to use and I’m already using cmder. I found wdRsync which seemed a good option:

~/Downloads $ curl -O https://www.itefix.net/dl/cwRsync_5.5.0_x86_Free.zip
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 100 3404k  100 3404k    0     0  2036k      0  0:00:01  0:00:01 --:--:-- 2095k
~/Downloads/ $ ls
cwRsync_5.5.0_x86_Free.zip
~/Downloads $

The setup was not that hard (I’m using the /c/Applications folder instead of the /c/Program Files):

~/Downloads $ unzip cwRsync_5.5.0_x86_Free.zip -d /c/Applications/cwRsync_5.5.0

It does work locally:

~/Downloads/rsync_test $ rsync -av from/ to/
sending incremental file list
created directory to
./
a/
a/first.txt
a/b/
a/b/second.txt
                                                   
sent 261 bytes  received 94 bytes  710.00 bytes/sec
total size is 0  speedup is 0.00

Remote over ssh works, too:

~/Downloads/rsync_test $ rsync -av -e ssh from/ "zsolt@192.168.1.2:/tmp/to/"
sending incremental file list
created directory to
./
a/
a/first.txt
a/b/
a/b/second.txt
                                                   
sent 261 bytes  received 94 bytes  1010.00 bytes/sec
total size is 0  speedup is 0.00

There are cases when it does not work:

~/Downloads/rsync_test $ rsync -av -e ssh from/ "zsolt@192.168.1.2:/tmp/to/"
dup() in/out/err failed
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.2]

This happens because of an ssh incompatibility. cwRsync comes with an ssh version (see cwRsync/bin), and rsync works just fine with it. If you have issue above, use it instead of the ssh that comes with your shell or OS. Instead of -e ssh use -e /c/Applications/cwRsync_5.5.0/bin/ssh:

~/Downloads/rsync_test $ rsync -av -e /c/Applications/cwRsync_5.5.0/bin/ssh
from/ "zsolt@192.168.1.2:/tmp/to/"

sending incremental file list

sent 166 bytes  received 14 bytes  360.00 bytes/sec
total size is 0  speedup is 0.00

comments powered by Disqus