Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I try to run a rsync on a shared server that I have no control over the ssh-config file to prevent the broken pipe error because the connection drop.

Here's a snippet of the code I use to backup

rsync -avz --blocking-io --delete-after --exclude 'mail*' /home user@remote:./backup/monthly/

Using this works fine for around 10min. , the the broken pipe error appears to tell me I've lost connection... probably because the rsync run in an idle state over SSH so SSH thinks I don't do anything while the rsync is running.

I've tried with and without --blocking-io but the connection still drop. Are they any trick to keep the SSH session alive until the rsync is complete without having access to the ssh-config file?

share|improve this question

1 Answer 1

This works providing your running OpenSSH.

Edit your ~/.ssh/config file and add the following to activate the keep-alive system for just your user for all host connected to.

If you want to do this just for one host, switch the * with a host name of your choosing.

Host *
    ServerAliveInterval 300
    ServerAliveCountMax 2
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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