Platinum Partner

Just #@$% Do It!

If you have an unreliable network feed and want to run something like rsync, scp, etc. without having to babysit it a simple function can be used to prefix a command.  The function looks like this:


# 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/
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}