Just #@$% do it!
# Function to force a command to try until it works. # Name means "JUST #@$% DO IT!" JFDI () { COMMAND=$* while ! $COMMAND ; do echo "Retrying..." ; done }
Using it is simplicity itself:
# command that can fail and annoy rsync -avz /my/local/directory/ myuser@host:~/my/remote/directory/ # command that won't give up ever JFDI rsync -avz /my/local/directory/ myuser@host:~/my/remote/directory/