Link to home
Start Free TrialLog in
Avatar of bt707
bt707Flag for United States of America

asked on

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,

Avatar of ahoffmann
ahoffmann
Flag of Germany image

yes, the while is an infinite loop
Avatar of ozo
Did you want to set $X depending on the result of the wget?
Avatar of bt707

ASKER

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,

ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bt707

ASKER

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.