rsync not working with latest kubuntu

Asked by John Jacq

just upgraded to 14.04 then I discovered rsync is not working.

jjjacq@aldebaran:~$ rsync -e ssh dates/april.html .html sirius:dates/april.html
protocol version mismatch - is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(62)
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.0]
jjjacq@aldebaran:~$

Even rsync by itself generates an error:
~$ rsync
.........
 -4, --ipv4 prefer IPv4
 -6, --ipv6 prefer IPv6
     --version print version number
(-h) --help show this help (-h is --help only if used alone)

Use "rsync --daemon --help" to see the daemon-mode command-line options.
Please see the rsync(1) and rsyncd.conf(5) man pages for full documentation.
See http://rsync.samba.org/ for updates, bug reports, and answers
rsync error: syntax or usage error (code 1) at main.c(1556) [client=3.1.0]
jjjacq@aldebaran:~$

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Are you using a desktop OS? If so you can use grsync.

Revision history for this message
John Jacq (jodn) said :
#2

No I use rsync with a cron job to do automatic backups in the background. It doesn't run from the desktop.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3
Revision history for this message
John Jacq (jodn) said :
#4

Andrew,

This does not solve my problem, firstly I know how to use rsync with ssh, I've been using it for several years now and I know how to read the man pages, and secondly it is rsync that does not work, not ssh, when it used to previously. It even fails copying a local file to another directory on the same machine, without using ssh at all.

I uninstalled it and re-installed it and it still does not work.

John

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Yes but at the bottom of the guide there are commands to use ssh with rsync. The first parts just show how to setup ssh but you can obviosly skip that part.

Did you try:

rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /file/to/send.txt servername:/path/to/dest/

Does that work?

Revision history for this message
John Jacq (jodn) said :
#6

On Sun, 27 Apr 2014 09:11:33 PM you wrote:
> Your question #247753 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/247753
>
> Status: Open => Needs information
>
> actionparsnip requested more information:
> Yes but at the bottom of the guide there are commands to use ssh with
> rsync. The first parts just show how to setup ssh but you can obviosly
> skip that part.
>
> Did you try:
>
> rsync -avz -e "ssh -o StrictHostKeyChecking=no -o
> UserKnownHostsFile=/dev/null" --progress /file/to/send.txt
> servername:/path/to/dest/
>
> Does that work?
>
>
No it doesn't work.

jjjacq@aldebaran:~$ rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /home/jjjacq/dates/*html sirius:/home/jjjacq/dates/
Warning: Permanently added 'sirius,192.168.1.2' (RSA) to the list of known hosts.
protocol version mismatch - is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(62)
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.0]
jjjacq@aldebaran:

The thing is I have no problem with the keys, neither the host key (the machine hasn't changed) nor the public/private keys. I load the private ones in ssh-agent and from then on everything works without the need for passwords or passphrases.

ssh and scp both work perfectly.

I must however correct one statement I made earlier, I said rsync did not work on the same machine (from directory to directory). That's not correct. Within one machine it works.

So while I'm not sure what this means, my guess is the new rsync on Aldebaran is not compatible with "bash" on Sirius. This is kind of weird as why would the bash standard commands be modified. I'll read the manual to see if there is a switch to force rsync to use only the most basic subset of commands in bash.

Revision history for this message
John Jacq (jodn) said :
#7

On Mon, 28 Apr 2014 06:11:42 AM you wrote:
> Your question #247753 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/247753
>
> Status: Needs information => Open
>
> You gave more information on the question:
> On Sun, 27 Apr 2014 09:11:33 PM you wrote:
> > Your question #247753 on Ubuntu changed:
> > https://answers.launchpad.net/ubuntu/+question/247753
> >
> > Status: Open => Needs information
> >
> > actionparsnip requested more information:
> > Yes but at the bottom of the guide there are commands to use ssh with
> > rsync. The first parts just show how to setup ssh but you can obviosly
> > skip that part.
> >
> > Did you try:
> >
> > rsync -avz -e "ssh -o StrictHostKeyChecking=no -o
> > UserKnownHostsFile=/dev/null" --progress /file/to/send.txt
> > servername:/path/to/dest/
> >
> > Does that work?
> >
> >
> No it doesn't work.
>
> jjjacq@aldebaran:~$ rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /home/jjjacq/dates/*html sirius:/home/jjjacq/dates/
> Warning: Permanently added 'sirius,192.168.1.2' (RSA) to the list of known hosts.
> protocol version mismatch - is your shell clean?
> (see the rsync man page for an explanation)
> rsync error: protocol incompatibility (code 2) at compat.c(62)
> 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.0]
> jjjacq@aldebaran:
>
> The thing is I have no problem with the keys, neither the host key (the
> machine hasn't changed) nor the public/private keys. I load the private
> ones in ssh-agent and from then on everything works without the need for
> passwords or passphrases.
>
> ssh and scp both work perfectly.
>
> I must however correct one statement I made earlier, I said rsync did
> not work on the same machine (from directory to directory). That's not
> correct. Within one machine it works.
>
> So while I'm not sure what this means, my guess is the new rsync on
> Aldebaran is not compatible with "bash" on Sirius. This is kind of weird
> as why would the bash standard commands be modified. I'll read the
> manual to see if there is a switch to force rsync to use only the most
> basic subset of commands in bash.
>
>

Ok here is the workaround, apparently older version of rsync refuse to communicate with newer ones (it stops when the protocol number exceeds 30) . It refuses to communicate even though it can.

So the workarounds are:

1) update the old version to a newer one on the remote machine (preferred if possible)
2) lie about the protocol number using "rsync --protocol=30"

I've aliased rsync to"rsync --protocol=30" in my .bash_aliases file, just in case I forget :)

John

Revision history for this message
Launchpad Janitor (janitor) said :
#8

This question was expired because it remained in the 'Open' state without activity for the last 15 days.