Rsync failed

General support questions
Post Reply
Posts: 5
Joined: 2013/11/27 18:16:22

Rsync failed

Post by dhwconnection » 2015/07/15 18:15:10


I've installed the CentOS 7 and I'd like to rsync a folder where it is on the CentOS 6, but it is failing.

CentOS 7 has installed: rsync-3.0.9-15.el7.x86_64
CentOS 6 has installed: rsync-3.0.6-12.el6.x86_64

I got the error below when I execute the command: "rsync -azu user@source_machine:/folderXYZ /destination_folder"
[protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(174) [Receiver=3.0.9]]

Using the same command and inserting "--protocol=30" or "--protocol=29" I got the same error.

Inside the user .bashrc account I don't have nothing configured. You can see below:
Using other account I got same error.

[# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc

Some suggestion?

Tks !

User avatar
Forum Moderator
Posts: 24618
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Rsync failed

Post by TrevorH » 2015/07/15 20:37:19

I've just tried this from CentOS 7, copying a directory from CentOS 6 to 7 then repeated the experiment in reverse and both directions work for me. I suspect that perhaps you might have a rogue copy of rsync in e.g. /usr/local/bin - try which rsync on both machines and see if you find it in the expected location on both.

Reading man rsync also shows me a paragraph at the end which says

Code: Select all

       rsync occasionally produces error messages that may seem a little cryptic. The one that seems to cause the most
       confusion is “protocol version mismatch — is your shell clean?”.

       This message is usually caused by your startup scripts or remote shell facility producing unwanted  garbage  on
       the  stream that rsync is using for its transport. The way to diagnose this problem is to run your remote shell
       like this:

              ssh remotehost /bin/true > out.dat

       then look at out.dat. If everything is working correctly then out.dat should be a zero length file. If you  are
       getting the above error from rsync then you will probably find that out.dat contains some text or data. Look at
       the contents and try to work out what is producing it. The most common cause is  incorrectly  configured  shell
       startup scripts (such as .cshrc or .profile) that contain output statements for non-interactive logins.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Posts: 5
Joined: 2013/11/27 18:16:22

Re: Rsync failed

Post by dhwconnection » 2015/10/14 17:36:24

Thanks TrevorH !!!

Post Reply