How to Use the Download Access Script for Earthdata Search

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
Earthdata - wxedward
User Services
User Services
Posts: 156
Joined: Wed Jan 17, 2024 10:24 am America/New_York
Answers: 22

How to Use the Download Access Script for Earthdata Search

by Earthdata - wxedward » Fri Feb 02, 2024 1:03 pm America/New_York

Instructions for how to use the download access script provided by Earthdata Search, which allows users to easily download large numbers of files.

IMPORTANT: The download access script works on Mac, Linux and Windows systems. Windows users will need to a program that emulates a Linux command line, such as Cygwin. Cygwin is free, and can be download here: https://www.cygwin.com/install.html

Step-by-step guide
In your Earthdata Login profile, make sure you have authorized the application from which you are downloading data (see How To Pre-authorize an application). There are many similarly named apps. If you aren't sure which one, authorize all apps you think could be relevant to your data. For example, if you are trying to get data from goldsmr5.gesdisc.eosdis.nasa.gov and it's not working, make sure you approve all the apps containing the word "GESDISC," just to be sure. After downloading the script, open Terminal (Mac or Linux) or Cygwin (Windows) and navigate to the folder that contains your script.
Image The files downloaded by this script will be downloaded to the folder that your script is in. If you want your files downloaded to a specific folder, please make sure to move the script to that folder before executing the script.

Next, run the following command to make the script executable:
chmod 777 download.sh


Image


Now that your script is executable, run the script using the following command. (Note: the leading period and forward slash is required.)
./download.sh


Image


The script will ask for your Earthdata Login credentials.

Image Note: your Earthdata Login username and password are case-sensitive, so be sure CAPSLOCK is off.


  • When asked for your Username, please enter your Earthdata Login username.
  • When asked for your Password, please enter your Earthdata Login password. When entering your password, you cannot see your password as you type. This is a Unix convention for security, but it can be confusing.
  • After entering your password, be sure to hit the RETURN key. After entering your password and hitting the RETURN key, the downloads will begin. You should start to see download statuses appear for each link present in the download script.
Image


At this point, you should start seeing files downloaded to your computer. The script will terminate once it has attempted to download the files specified in the script.

Image


IF YOU HAVE PROBLEMS WITH THE SCRIPT
To download multiple files, a simple alternative to the script is to use wget as follows:
wget--user=myusername --password=mypassword -i url_list.txt
where myusername is your Earthdata Login username, mypassword is your Earthdata Login password, and url_list.txt is a text file with one granule download link per line.

For convenience, wget can pull urls directly out of Earthdata Search's download access script, so the following will also work:
wget --user=myusername --password=mypassword -i download.sh
To download a single file, you can use wget as follows:
wget --user=myusername --password=mypassword url
where url is link for the file you want to download.

Another alternative is to use DownloadThemAll!, an add-in for the Firefox browser. (TIP: By adding .txt to the end of the download script, you can use DownloadThemAll!'s "import from file" feature to download the links it contains.). DownloadThemAll! is not compatible with Firefox Quantum, so be sure to check your version of Firefox to verify compatibility.

An alternative to DownloadThemAll! is "Chrono Download Manager," an extension for the Google Chrome browser that has many of the features of DownloadThemAll! for Firefox.

Image IF YOU HAVE CONNECTION FAILURES
  • Connection failures like "Operation timed out" or "No route to host" are an indication that the data provider's server may be temporarily unavailable.
  • To see a list of known data provider outages, click the alerts button (the little bell icon) in the upper right-hand corner of Earthdata Search.
Image IF YOU SEE THE ERROR "curl:option --netrc-file: is unknown"

  • When running the script, if you get the error

    curl: option --netrc-file: is unknown


    this means the curl command is not recognizing the option --netrc-file.
  • The --netrc-file option was added in curl version 7.21.5. You can check your version of curl by running the following command:
    curl -V
  • If your version of curl is less than 7.21.5, you need to update curl.
  • If you have .netrc already set up with your login credentials, you may be able to get the script to work without updating curl by editing the script and removing the following from the curl command line: --netrc-file "$netrc"
Image IF YOU DO NOT HAVE WGET
Image IF YOU ARE A WINDOWS USER
Image IF YOU SEE THE ERROR "is not recognized as an internal or external command" ON WINDOWS
The download access script works on Windows systems with a program that emulates a Linux command line, such as Cygwin.

If you are a Windows user and you do not have Cygwin, you can download it here: https://www.cygwin.com/install.html

Tags:

yousafzafar119
Posts: 1
Joined: Fri Mar 15, 2024 1:59 am America/New_York
Answers: 0

Re: How to Use the Download Access Script for Earthdata Search

by yousafzafar119 » Fri Mar 15, 2024 2:01 am America/New_York

Windows 7 is getting problem during install of that Cygwin. It this script runner software is compatible with Windows 7? I double click on it nothing happened.

Post Reply