Created
December 10, 2012 09:00
-
-
Save cynici/4249450 to your computer and use it in GitHub Desktop.
NPP: Download GDAS cron script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# This script downloads all gdas1.PGrbF00.*.*.z of previous day or | |
# whichever day specified by '-d' options given to 'date' command | |
# into current directory. | |
# | |
# Download GDAS of a specific day using '-d' option of date command. | |
# | |
# The Global Data Assimilation System (GDAS) files are required | |
# by VIIRS TrueColorGen algorithm | |
# | |
set -e | |
if [ -t ]; then | |
verbose='--verbose' | |
else | |
verbose='--no-verbose' | |
fi | |
# Download GDAS of previous day by default | |
if [ $# -eq 0 ]; then | |
yymmdd=$(date +'%y%m%d' '-d yesterday') | |
else | |
yymmdd=$(date +'%y%m%d' "$@") | |
fi | |
for hour in "00" "06" "12" "18"; do | |
# Only download newer files | |
wget $verbose -N ftp://is.sci.gsfc.nasa.gov/ancillary/temporal/global/gdas/gdas1.PGrbF00.${yymmdd}.${hour}z | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment