Skip to content

Instantly share code, notes, and snippets.

@jenyayel
Created April 20, 2020 22:04
Show Gist options
  • Save jenyayel/531e568c27a52e8b87fc3d811115f38c to your computer and use it in GitHub Desktop.
Save jenyayel/531e568c27a52e8b87fc3d811115f38c to your computer and use it in GitHub Desktop.
Runs rsync with retry
#!/bin/bash
while [ 1 ]
do
rsync \
--progress \
--partial \
--append \
--timeout=30 \
-vz \
-e ssh $src_path $dest_path
if [[ $? -eq 0 ]] ; then
echo "rsync completed"
exit
else
echo "rsync failure, retrying..."
sleep 10
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment