Over a million developers have joined DZone.

Just #@$% Do It!

DZone's Guide to

Just #@$% Do It!

Free Resource
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 () {
  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/

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}