Skip to content

Instantly share code, notes, and snippets.

@kennyLtv
Last active May 15, 2019 15:04
Show Gist options
  • Save kennyLtv/930b5bab9e51f7c0e440b8ecaec315e9 to your computer and use it in GitHub Desktop.
Save kennyLtv/930b5bab9e51f7c0e440b8ecaec315e9 to your computer and use it in GitHub Desktop.
rsync reconnect on a failed transfers
#!/bin/bash
while [ 1 ]
do
rsync -avz --progress <user>@<host>:/usr/www/dmfrenzycom/public /var/www/vhosts/dmfrenzy.com/test/public
if [ "$?" = "0" ]; then
echo "rsync completed on its own";
exit
else
echo "We failed, gotta catch them all";
sleep 20;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment