Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I make use of wget to get files from an FTP server. I do this:

wget ftp://username:Password@XXX.XXX.XX.XX/public_html/images/audiothumbs/* .

After I download about a 1600 files, I get this error:

--2010-09-07 01:36:51--  http://./
Resolving .... failed: Name or service not known.
wget: unable to resolve host address `.'
FINISHED --2010-09-07 01:36:52--
Downloaded: 1998 files, 20M in 3m 31s (95.7 KB/s)

Did I get disconnected from the other server?

Secondly, if make use of the no-clobber option like so:

wget -r -nc ftp://username:Password@XXX.XXX.XX.XX/public_html/images/audiothumbs/* .

Why is it files still get overwritten?

Thanks all for any help

share|improve this question

migrated from Sep 7 '10 at 1:00

This question came from our site for professional and enthusiast programmers.

up vote 5 down vote accepted

You've got an extra . on the end of your command line. wget is not like cp and doesn't take a destination directory. So after it downloads all your files from the FTP server, it tries to download a file (using HTTP) from the server ..

And for -nc, it's documented to do something other than what you expect:

      When running Wget without -N, -nc, or -r, downloading the same file
      in the same directory will result in the original copy of file
      being preserved and the second copy being named file.1.  If that
      file is downloaded yet again, the third copy will be named file.2,
      and so on.  When -nc is specified, this behavior is suppressed, and
      Wget will refuse to download newer copies of file.  Therefore,
      ‘‘"no-clobber"’’ is actually a misnomer in this mode---it’s not
      clobbering that’s prevented (as the numeric suffixes were already
      preventing clobbering), but rather the multiple version saving
      that’s prevented.
share|improve this answer
Ah I see, I have removed that extra dot and the -nc seems to work for me now, without the -r. But the wget seems to only download 2000 of the 10000 files, is there a limit on wget, surley not, its just me?! – Abs Sep 7 '10 at 0:13
You are probably running into a command line limit. How long is the list of 2000 files? – mpez0 Sep 7 '10 at 1:07
You can try multiple wgets, with [a-d]* [e-k]*, etc. – mpez0 Sep 7 '10 at 1:07
You are right, FTP has that limit. I have switched over to the SCP command and I am seeing if this works, I will update question tomorrow, its going to take a couple of hours. – Abs Sep 7 '10 at 1:09

Please not that max recursion in the download directory is 5!

When downloading from ftp using wget you have to set recursion depth:

-l depth --level=depth

Specify recursion maximum depth level depth. The default maximum depth is 5.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.