NOAA Center for Satellite Applications and Research banner
Intranet • Contact • Skip navigation
National Oceanic & Atmospheric Administration website NOAA Center for Satellite Applications and Research website

STAR - Global Vegetation Health Products :

Procedure for automatically downloading VH data

If Vegetation Health data file are available online, we can set up to download recent weeks' data by the following procedure.

Step1. add a line to the file ".netrc" in user's home directory

This will avoid user to manually provide ID and password when calling "ftp" command.
default login anonymous password
(please replace by user's email address)

Step 2: We need a parameter file in ASCII format for "ftp" command

filename= ftp_VHP4km.txt (for example)
file content:

cd /pub/corp/scsb/wguo/data/VHP_4km/VH/
prompt off
mget *

Step 3: write a script to automatically create above parameter file base on compute time

file name :
YEAR=`date +%Y`
YOFYEAR=`date +%j`
WEEK=$[(10#$(date +"%j") -1)/ 7]

if [ $WEEK -lt 10 ]; then

echo "open"
echo "cd /pub/corp/scsb/wguo/data/VHP_4km/VH/"
echo "bin"
echo "prompt off"

echo "mget *${YEAR}0${Week2}"

Step 4: write a script (example: "") to create parameter file abd run "ftp" command

content: > ftp_VHP4km.txt
ftp < ftp_VHP4km.txt

Step 5: schedule to run "" command on every Tuesday 18:50 by "crontab"

$ crontab -e
50 18 * * 2