sh_wget_nav -yrs 2005 -yre 2006 -doys 360 -doye 3
sh_wget_nav:
#!/bin/sh
local_root=/cygdrive/e/igs/pub/nav
yearStart=2005
yearStart=1999
#yearStart=2001
yearEnd=2007
doys=001
doye=`ymd2ydoy ${yearStart} 12 31 | awk '{print $2}'`
# process command-line parameters
#####################################################
#COMMAND LINE PARAMETERS
#####################################################
while [ "$1" != "" ]
do
#echo $1
case $1 in
-dir)
cd $2
local_root=$2
;;
-yrs)
yearStart=$2
yr=`echo $yearStart | awk '{print substr($0,3,2)}'`
y=`echo $yearStart | awk '{print substr($0,4,1)}'`
ndays=`ymd2ydoy ${yearStart} 12 31 | awk '{print $2}'`
;;
-yre)
yearEnd=$2
;;
-doys)
doys=$2
;;
-doye)
doye=$2
;;
-sites)
sites=$2
sites=`echo $sites | awk -F, '{for (i=1;i<=NF;i++) print $i}'`
;;
-sitefile)
sfile=$2
sites=`sh_site_read $sfile`
#echo $sites
;;
*)
echo "invalid options: $1"
exit 1
;;
esac
shift 2
done
#echo $sites
#echo $sites
#exit
year=${yearStart}
while [ ${year} -le ${yearEnd} ]; do
if [ ${year} -eq ${yearStart} ]; then
doy=${doys}
else
doy=001
fi
if [ ${year} -eq ${yearEnd} ]; then
ndays=${doye}
else
ndays=`ymd2ydoy ${year} 12 31 | awk '{print $2}'`
fi
yy=`echo $year | awk '{print substr($0,3,2)}'`
while [ ${doy} -le ${ndays} ]; do
doy=`echo $doy | awk '{printf("%03d",$0)'}`
day_dir=${local_root}/${year}/${doy}
mkdir -p ${day_dir}
cd ${day_dir}
pwd
echo "wget -c --user=anonymous --password=tianyf@gmail.com http://garner.ucsd.edu/pub/rinex/${year}/${doy}/auto${doy}0.${yy}n.Z -O brdc${doy}0.${yy}n.Z"
#from HTTP Server
wget -c --user=anonymous --password=tianyf@gmail.com http://garner.ucsd.edu/pub/rinex/${year}/${doy}/auto${doy}0.${yy}n.Z -O brdc${doy}0.${yy}n.Z
#from FTP Server
#wget -c ftp://garner.ucsd.edu/pub/rinex/${year}/${doy}/auto${doy}0.${yy}n.Z -O brdc${doy}0.${yy}n.Z
doy=`expr $doy + 1`
done
year=`expr $year + 1`
done
No comments:
Post a Comment