1

I'm trying to rsync content from local machine (Windows 7 on 64bits) to remote server (Ubuntu 8 on 64bits) and it fails. Any piece of advice is more than welcome as I've already spent too much time with this crap... Thanks in advance!

$ ls -al
total 3
drwxr-xr-x    4 www www     4096 Jun  7 11:04 .
drwxr-xr-x    5 www www     4096 Jun  7 13:13 ..
drwxr-xr-x    7 www www        0 Jun  7 11:04 release-20110607110404

$ rsync -avz ./release-20110607110404/ www@web1:/home/www/
opening connection using: ssh -l www web1 rsync --server -vvlogDtprze.iLsf . /home/www/
select: Bad file number
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(610) [sender=3.0.8]

$ rsync --version
rsync  version 3.0.8  protocol version 30
Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, no xattrs, iconv, symtimes   
eistrati
  • 2,314
  • 6
  • 26
  • 35
  • I should add that I'm using cwRsync (C:\Program Files (x86)\cwRsync\bin\rsync.exe) – eistrati Jun 07 '11 at 17:53
  • rsync server is running ok on the ubuntu machine? you can ping ubuntu from win-7? checked your firewall rules to make sure the rsync connection can open? – ribram Jun 07 '11 at 18:08
  • Just in case anyone else runs into this, the problem is caused from the ssh.exe that mingw uses, as in the msysgit above and the ssh.exe that comes with whatever version of rsync you're using on windows. If you change the order these two bin folders are defined in your system variable, you'll get different results.. one will work.. one won't.. – 2potatocakes Jun 14 '11 at 05:57

2 Answers2

1

Heh, I figured it out, at least found the problem's source... It doesn't work in git bash from msysgit (code.google.com/p/msysgit), but it works in regular windows command line! Weird!!!

eistrati
  • 2,314
  • 6
  • 26
  • 35
  • Thanks. I was actually searching the same error for a different problem and I was also using Git Bash as my command line environment. So, same problem and solution for using Python easy_install on Windows with Git Bash. – Rich Jun 19 '12 at 19:15
  • cwRsync comes with an ssh client which is different from the one that comes with gitbash. This could be a major part of the issue, if not the entire thing. I'm having the same or similar problem so I'll post again if I get anywhere with it. – Okonomiyaki3000 Jun 20 '14 at 07:20
0

Alright, check this out. GitBash comes with a bunch of *nix utilities (including ssh) but cwRsync also comes with ssh. Now, on my system, the version of ssh that ships with GitBash is crazily out of date while the one that comes with cwRsync is very recent. If I run which ssh from inside GitBash, obviously the GitBash version shows up. So, guess which version rsync will use? The wrong one, I guess.

You can work around this.

You are trying to run this command:

rsync -avz ./release-20110607110404/ www@web1:/home/www/

But since you want to use a different ssh, you'll need something like this:

rsync -avz -e '<path to cwRsync ssh> www@web1' ./release-20110607110404/ :/home/www/

Now, if you're anything like me, you'll have another problem which is that ssh will complain that your ssh config file has the wrong permissions. That's because it's looking in /cygdrive/<the correct path to your config file> for some reason. But this too is fixable:

rsync -avz -e '<path to cwRsync ssh> -F <path to ssh config> www@web1' ./release-20110607110404/ :/home/www/

Now, keep in mind that the paths you must use to ssh and to your ssh config file need to be in the silly windows backslash format (at least my system seems to complain if I don't use that format) but I believe this will work for you and you can stay in GitBash instead of using cmd.

Okonomiyaki3000
  • 3,628
  • 23
  • 23