#!/bin/sh
# NAME
# sh_wget_rnx
local_root=~/igs/pub/rinex
local_root=/i/data.server/pub/rinex
local_root=/cygdrive/i/data.server/pub/rinex
local_root=/cygdrive/l/igs3/pub/rinex
local_root=/cygdrive/k/igs_data/pub/hfiles
#local_root=/cygdrive/i/igs_data/pub/hfiles
local_root=/cygdrive/j/igs2/pub/rinex
yearStart=2005
yearStart=1999
yearStart=2001
yearEnd=2002
doys=001
doye=`ymd2ydoy ${yearStart} 12 31 | awk '{print $2}'`
sites=lhaz,guao,shao,kunm,irkt,irkm,naga,tnml,taiw,aira,daej,khaj,suwn,ulab,yaka,kit3
# 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
;;
*)
echo "invalid options: $1"
exit 1
;;
esac
shift 2
done
#echo $sites
sites=`echo $sites | awk -F, '{for (i=1;i<=NF;i++) print $i}'`
#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 -nc --http-user=anonymous --http-password=tianyf@gmail.com http://garner.ucsd.edu/pub/hfiles/${year}/${doy}/higs2a.${yy}${doy}.Z"
for site in $sites; do
wget -nc --http-user=anonymous --http-password=tianyf@gmail.com http://garner.ucsd.edu/pub/rinex/${year}/${doy}/${site}${doy}0.${yy}d.Z
done
doy=`expr $doy + 1`
done
year=`expr $year + 1`
done
It seems that HTTP GARNER connections are much faster than FTP GARNER. Thus, I chose the former to download data. However, if you use ftp/ncftp to download files, the latter should be more friendly.
Subscribe to:
Post Comments (Atom)
1 comment:
Hello Dear.
Im specialist of GNSS CORS.
Im glad to be visit your nice blog
Post a Comment