Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

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 () {
  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/
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}