rsync: connection unexpectedly closed (... bytes received so far) [sender]
I have regular server backups which transfers large files over 500GB+ and have
ssh parameters specified.
What I have found upon analysis is that once the client side completes it's file checks then the server side checks start. Which means while the server is doing it's checks the client side will appear hanged and frozen - run
htop on the server to rsync working away.
On related note, this very LONG wait would trigger SSH timeout and a
rsync: connection unexpectedly closed (254 bytes received so far) [sender] error message, solution is to add below settings to your
# This will make the server send the clients a “null packet” every 120 seconds and not disconnect them until the client # have been inactive for 720 intervals (120 seconds * 720 = 86400 seconds = 24 hours). ClientAliveInterval 120 ClientAliveCountMax 720
Both issues are likely a non issues if
rsync is run in deamon mode on the server and using the
rsync protocol instead of
ssh for transfers. If this has helped you please comment or follow me on twitter @danielsokolow