Rsync error after a period of syncing (error in rsync protocol data stream) I am trying to use a standard rsync via ssh between a local MacBook Pro and a remote Linux based machine (WD MyCloud). There is no problem initializing it, but after syncing for a while I always get the following error message:

rsync: connection unexpectedly closed (6969766427 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-45/rsync/io.c(453) [receiver=2.6.9]
rsync: connection unexpectedly closed (44480 bytes received so far) [generator]
rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-45/rsync/io.c(453) [generator=2.6.9]


Sometimes it manages to sync several gig of data, sometimes less than that, but I have yet failed to finish the sync.

I am using a standard rsync setup:

rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/


Any ideas?
Solution in my case: update rsync.

As is clear from point 3 in the rsync "current issues and debugging" page, 


  This error tells you that the local rsync was trying to talk to the
  remote rsync, but the connection to that rsync is now gone. The thing
  you must figure out is why, and that can involve some investigative
  work.


In other words, detective work is needed to isolate the root cause. One of the first things suggested is to update rsync. It turns out that Apple has not given us the latest rsync in their machines. Thus, I updated the rsync version on my Mac via Macports to 3.1.1. In addition, in order to minimise the strain on the rather weak processor of my WD MyCloud machine, I made sure to run only one rsync process at a time. After that, I have had no problems syncing.

This is no general solution, of course, but then again there seem to be no general solution for this vague error message: if this had not worked, I had had to try and debug it. For details on how, see the above-mentioned rsync issues page.