7

When doing an rsync pull from a remote server using the following command:

/usr/bin/rsync -av -e ssh --delete --chmod=a+rwx,g+rwx,o-wx --dry-run username@server:/remote/path/ /home/dir/local/path

I get the following error:

receiving file list ... Invalid flist flag: 1004
rsync error: protocol incompatibility (code 2) at flist.c(2354) [Receiver=3.0.7]

When doing the reverse (ie. PUSH) from remote to local, i get the following:

building file list ... Invalid flist flag: 1004
rsync error: protocol incompatibility (code 2) at flist.c(2354) [Receiver=3.0.7]
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(468) [sender=2.6.8]

I've tried removing the parameters one by one and it seems to be related to the -a flag

Environment

# local machine
Linux lbox 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
# rsync version
rsync  version 3.0.7  protocol version 30

# remote machine
FreeBSD rbox 6.4-STABLE FreeBSD 6.4-STABLE #0: Mon Feb 22 01:05:13 EST 2010     UNIX-BSD
rsync  version 2.6.8  protocol version 29

Can this be resolved easily?

denormalizer
  • 471
  • 2
  • 5
  • 15
  • 1
    can be related : http://serverfault.com/questions/304125/rsync-seems-incompatible-with-bashrc-causes-is-your-shell-clean – cstamas Oct 05 '12 at 07:03
  • I didn't get the 'is your shell clean' error. And as you can see the exceptions are thrown in different parts of the rsync source code. – denormalizer Oct 08 '12 at 00:24

2 Answers2

10

The FreeBSD box has a six-year-old version of rsync which uses an older protocol version. You can force the new version of rsync to use the old protocol by adding --protocol=29 to your rsync command.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
4

Interestingly, putting an intermediary machine between origin and destination machine achieves the desired result:

ie.

machine 1 (origin) >> machine 2 (intermediary) >> machine 3 (destination)

machine 1: rsync  version 2.6.8  protocol version 29
machine 2: rsync  version 3.0.3  protocol version 30
machine 3: rsync  version 3.0.7  protocol version 30
denormalizer
  • 471
  • 2
  • 5
  • 15