wget loop

Have a small scipt a friend made for running wget to pull down a file.

can someone explain what the varible here is actually doing, seems to just be keeping the loop going, what's the difference here in using this loop with wget and
just using a straight command to start wget such as

/usr/bin/wget -r -c -N -l 1 http://server.com/tmp/file1.gz


#!/bin/sh
X=1
while [ $X = 1 ]
do
/usr/bin/wget -r -c -N -l 1 http://server.com/tmp/file1.gz
done



Thanks,

bt707Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ahoffmannCommented:
yes, the while is an infinite loop
ozoCommented:
Did you want to set $X depending on the result of the wget?
bt707Author Commented:
just wanted to verify that the while loop here was set just to be a infinite loop as ahoffmann said.

used this once to pull a big file to a remote server that has very bad bandwith and connections, worked out good. Just looking for a good way to run wget in a case like this where
connections are dropped and restarted sometimes, also where the command can be started then the session closed and reopened at a later time to check on the job.

Thanks,

ahoffmannCommented:
not sure if your wget returns an error status for aborted downloads, if so replace the while with:
while [ $? -ne 0 ]

if your wget does not report an aborted download, use curl instead

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bt707Author Commented:
thanks ahoffmann, I'll try this out, the wget works really good, I couldn't even kill it witout a kill, did try out a few test and even when killing it
then restarting it picks up right where it left off, very nice, will look into the curl also, never heard of it.

Thanks again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.