Skip to content

Instantly share code, notes, and snippets.

@michaelesmith
Last active August 29, 2015 14:06
Show Gist options
  • Save michaelesmith/ee1d82d09e1d28d2c314 to your computer and use it in GitHub Desktop.
Save michaelesmith/ee1d82d09e1d28d2c314 to your computer and use it in GitHub Desktop.
Retry a network app max tries and wait
n=0
until [ $n -ge 5 ] || ./symfony syn:cams-import --force --quiet; do
echo Tansfer disrupted, retrying...
n=$[$n+1]
sleep 120
done
if [ $? -eq 0 ]
then
echo Command completed successfully
else
echo Command failed retired $n times
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment