Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Created December 1, 2012 15:15
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pwenzel/4182838 to your computer and use it in GitHub Desktop.
Save pwenzel/4182838 to your computer and use it in GitHub Desktop.
Automatically resume rsync over SSH after broken connection
#!/bin/bash
while [ 1 ]
do
rsync -avz --partial source dest
if [ "$?" = "0" ] ; then
echo "rsync completed normally"
exit
else
echo "Rsync failure. Backing off and retrying..."
sleep 180
fi
done
@dhval
Copy link

dhval commented Jan 24, 2015

while ! rysnc <…> ;do sleep 180; done

@sunk818
Copy link

sunk818 commented Apr 20, 2016

What is rsync is running but the transfer has stopped for some reason but rsync has not exited?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment