sridaily.sh

InfoInfo
Search:    

# Written by Erik Johnson July 2007
# This program is run at 19:35 every day.
# It downloads the latest MACCS raw data files from SRI's ftp site and files them into the MACCS_DATA/Raw/ folder.

SOURCE='/Volumes/physics_data/Ftp/MACCS_DATA/Raw'
YEAR=`date +%Y`
YY=`date +%y`
DAY=`date +%j`
NDAY=`echo $DAY + 1 | bc`
PDAY=`echo $DAY - 1 | bc`
P2DAY=`echo $DAY - 2 | bc`

#insert the necessary leading zeros for DAY
#if [ $DAY -lt 10 ]; then
# DAY=00$DAY
#elif [ $DAY -lt 100 ]; then
# DAY=0$DAY
#fi

if [ $NDAY -lt 10 ]; then

elif [ $NDAY -lt 100 ]; then

fi
if [ $PDAY -lt 10 ]; then

elif [ $PDAY -lt 100 ]; then

fi
if [ $P2DAY -lt 10 ]; then

elif [ $P2DAY -lt 100 ]; then

fi

#get the files from SRI
cd $SOURCE/CD/${YEAR}ir/

ftp -n << END_SCRIPT
open 128.18.144.24
user anonymous teakjohnson@embarqmail.com

epsv4
cd pub/maccs/CD/magnetometer/
get CD${YY}${P2DAY}.dat
get CD${YY}${PDAY}.dat
get CD${YY}${DAY}.dat
get CD${YY}${NDAY}.dat

lcd $SOURCE/NA/${YEAR}ir/
cd ../../NA/magnetometer
get NA${YY}${P2DAY}.dat
get NA${YY}${PDAY}.dat
get NA${YY}${DAY}.dat
get NA${YY}${NDAY}.dat

bye
END_SCRIPT

This is a Wiki Spot wiki. Wiki Spot is a non-profit organization that helps communities collaborate via wikis.