Last active
August 29, 2015 14:06
-
-
Save michaelesmith/ee1d82d09e1d28d2c314 to your computer and use it in GitHub Desktop.
Retry a network app max tries and wait
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
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