Forum Moderators: bakedjake

Message Too Old, No Replies

rsync question

How to rsync between hosts

         

kokako

8:31 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



Hi,

first-time posting here ...

I have a problem working out how to use rsync between two separate hosts/domains.

I connect to my host via SSH (using PuTTY).

I used this command:


$ rsync -e ssh backups username@otherhost.com:testbackup

with "backups" being the directory on my host and "testbackup" the directory I want to rsync on the other host.

I am prompted for the password for otherhost - OK.

Then I get this error:
-----------------------
protocol version mismatch - is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(58)
------------------------
I did the test, as advised under section DIAGNOSTICS in the man pages, and


/bin/true > out.dat

produced a zero-length file; which means it should be OK.

So now I don't know where else to look. Any ideas?
Do I need to use a different combo of options for the rsync command?

bakedjake

4:22 pm on Oct 30, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld kokako!

rsync error: protocol incompatibility

That's your answer. It sounds like you're using OpenSSH, which has interoperability issues at times with other programs.

Try upgrading both rsync and ssh to the latest releases, or alternatively, get a copy of commercial SSH. We use commercial SSH with rsync here all of the time with zero issues.

bcolflesh

4:27 pm on Oct 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could try the wrapper posted here:

linuxmafia.com/pub/linux/security/ylonen-ssh/ssh-rsync-wrapper

kokako

10:32 pm on Oct 30, 2003 (gmt 0)

10+ Year Member



Thanks a lot for the explanation, bakedjake - makes me feel better at least to know what the problem is :)

Yes, the server uses OpenSSH.
I have a hosted account there, so no chance of doing any upgrading myself. Likewise, I can't install the wrapper myself (thanks for that tip), but I'll pass it on to the support staff.

Great forum!

drbrain

6:12 pm on Nov 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I very very highly doubt this is a problem with ssh, since the error message says "rsync error: protocol incompatibility (code 2) at compat.c(58)". At this point, the SSH tunnel is working great, and rsync seems to be having the version mismatch.

If you can ssh just fine between the two hosts, I highly doubt the ssh is the culprit. Upgrade rsync on both ends, the website warns that different versions of rsync may be incompatible.

All you need to know about rsync is:

rsync -avz localdir/ remote:dir

(mind your '/'s, they are important, and set RSYNC_RSH in /etc/profile, so don't need the -e option)

To sync between my laptop and desktop, I have a nice little script:

rsync -av --exclude-from=$HOME/.rsync_exclude ~/ remote:~

Where .rsync_exclude contains everything I don't want to transfer, like SSH authorized hosts and keys, shell history, mozilla profile, etc.

Nova Reticulis

3:59 pm on Nov 17, 2003 (gmt 0)

10+ Year Member



Make sure your remote shell doesn't get confused between interactive and noninteractive sessions and doesn't spew random garbage.

kokako

10:39 am on Nov 24, 2003 (gmt 0)

10+ Year Member



Happy tidings :)
My host did various upgrades/updates and now rsync works fine and I don't get any more error notices.

The only thing that needed tweaking with my command was to add the archiving option, which is definitely required.
So thanks for the -avz pointer.
Quite obvious really ... now I come to think about it <g>.

I was only able to test this between servers with the same setup (with my hosting company). So I guess there may still be problems rsyncing between servers that have different versions of ssh, rsync etc. installed.