-
-
Save gokycat/009b83423181da2253cc78681216c2ba to your computer and use it in GitHub Desktop.
Automatically resume rsync over SSH after broken connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment