Forum Moderators: bakedjake
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
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
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?
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.
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!
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.
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.