Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are a large number of different versions of wget in use today, working across a wide range of platforms, so producing a single set of instructions to get it working in all cases is very difficult. If you are having problems downloading files using wget, you can use some of these steps to identify the problem.

 

Check your .netrc file

In many cases, the .netrc file can be used to configure your Earthdata Login credentials, but if this is not configured correctly, authentication will fail. If your Earthdata Login username is 'john.q.smith' and your password is 'abc123DEF!', then your .netrc should look like this:

 

machine urs.earthdata.nasa.gov login john.q.smith password abc123DEF!

 

If you can run Perl scripts, you can also try using our tool to create the .netrc file for you.

 

Test With Curl

Most Unix type systems (Linux, Mac OSX, etc) come with 'curl', another useful command line tool that can also download files. Curl can also use the .netrc file and can therefore be used to verify the credentials are set correctly. Since curl only downloads one file at a time, you should pick one file and run a test as follows:

 

curl -b ~/.urs_cookies -L -n <url> -o test


Where <url> is the full URL of the file you wish to download. e.g.


curl -b ~/.nocookies -L -n
http://e4ftl01.cr.usgs.gov/MOLT/MOD13Q1.005/2016.08.28/MOD13Q1.A2016241.h00v08.005.2016258025246.hdf
 -o test

 

If this is successful, it will save the downloaded data as a file called 'test' in your current directory, showing that your .netrc file is valid.

 

Try .wgetrc

Some version of wget on Windows will not use a .netrc file. In this case, you may be able to use '.wgetrc' -  a configuration file specific to wget. As with .netrc, this is a simple text file that must go in your home directory, and should have contents as follows:


http_user = john.q.smith
http_password = abc123DEF!
 

though obviously you should use your own username and password!

 

Use Command Line Options

If you cannot get wget to work with .netrc or .wgetrc, you can fall back to using command line options. First, make sure that all instances of .netrc and .wgetrc have been removed. Next, pick one file that you are attempting to download and try wget with the --http-user and --ask-password option:

 

wget --http-user=john.q.smith --ask-password --keep-session-cookies http://e4ftl01.cr.usgs.gov/ASTT/AST_L1T.003/2016.09.11/AST_L1T_00309112016020239_20160912100405_5264_QA.txt


Note that not all version of wget support the --ask-password option. In this case (and for test purposes only), you can use --http-password instead:

 

wget --http-user=john.q.smith --http-password=abc123DEF! --keep-session-cookies http://e4ftl01.cr.usgs.gov/ASTT/AST_L1T.003/2016.09.11/AST_L1T_00309112016020239_20160912100405_5264_QA.txt

 

Hide comments