restic: sftp backend does not reconnect

I’m trying to back up data to Hetzner’s backup space (http://wiki.hetzner.de/index.php/Backup/en). It starts nicely with ~15-20MiB/sec, but as soon as I’m receiving a Write failed: Broken pipes or Connection to uXXX.your-backup.de closed by remote host. from Hetzner’s backup space then restic is permanently decreasing its performance to <1MiB/s and doesn’t seem to be able to recover from it. While this clearly seems to be a problem from Hetzner’s backend storage I can’t find a ssh configuration (TCPKeepAlive, ServerAliveInterval,…) which would work around this problem. It would be nice if restic could recover from this situation itself.

Thanks for restic! 😃

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Comments: 38 (13 by maintainers)

Most upvoted comments

For your information: We’ve recently figured out that some sftp servers disconnect clients after a while without activity, you can prevent that with restic by adding the following settings to the ~/.ssh/config file for the server:

ServerAliveInterval 60
ServerAliveCountMax 240

See: https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#sftp

@johnflan I also had tons of troubles with restic and Hetzner, what was also relevant for me was https://docs.hetzner.com/robot/dedicated-server/troubleshooting/performance-intel-i218-nic - if you’re running a dedicated server at Hetzner, consider giving this a try

Yes, restic prune will take care of that.