I am using rsync over ssh to perform backups from a client to a remote server.

rsync -azLvv --progress -e 'ssh -p22 -vvv' --exclude 'foo' /home/user/ server.tld:Documents/backup/

It was working fine for six months and it stopped working few days ago.

             41 100%    0.08kB/s    0:00:00 (xfr#81, to-chk=36/12092)
debug3: send packet: type 1
Connection reset by A.B.C.D port 22
rsync: connection unexpectedly closed (3211265 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.2]

It is working if I skip some files, e.g. git repositories. The ssh connection works since I have a session open on this server for days from this client.

Rsync version on the client 3.1.2, version on the server 3.1.1.

  • Similar to serverfault.com/questions/447699/… Sep 5 '18 at 10:13
  • Thank you for your answer. I'm launching the command from the term, not from crontab. The port 22 is opened in my firewall (I can connect to ssh). The connection has been initiate and many of the files was been synchronized, as shown by the "(3211265 bytes received so far)". I don't use password, I use key, so it's not that either. I am not ban by fail2ban, as it's not install on the server side. I will look into the checksum issue (some of the files are 40GB so it might take too long to compute them.
    – Clèm
    Sep 6 '18 at 7:30

It appears the issue was indeed some time out while synchronizing large files (~40GB). Add the keep alive options solved the issue. Following this answer https://serverfault.com/a/818482/399792 I added to ~/.ssh/config

Host *
  ServerAliveInterval 30
  ServerAliveCountMax 6

I also added to /etc/ssh/sshd_config

ClientAliveInterval 30
ClientAliveCountMax 6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.