#!/usr/bin/ksh # # call_wget_intermagnet_gmag.ksh - This script sets the arguments # to the script which downloads INTERMAGNET gmag data # # November 16 2011 lphilpott@igpp.ucla.edu # Based heavily on: call_wget_green_gmag.ksh, call_wget_maccs_gmag.ksh, epo_ucla_rmd_mirror_batch.ksh # # ## Set the environment variables # if [[ -z $THMSOC ]] then THMSOC=/disks/socware/thmsoc_dp_current export THMSOC fi #. ${THMSOC}/src/config/soc_it_to_me.config . /home/thmsoc/lphilpotts_stuff/intermagnet_test/soc_it_to_me_test.config # ## Determine dates to check # thisYear=$(date -u '+%Y') thisMonth=$(date -u '+%m') integer ithisMonth=$thisMonth integer ilastMonth=$(( ithisMonth - 1 )) if (( $ilastMonth <= 0 )) then lastMonth=12 lastYear=$(( $thisYear - 1 )) else lastYear=$thisYear lastMonth=$(echo $ilastMonth | awk '{printf("%02d",$1)}') fi thisYearMonth=${thisYear}_${thisMonth} lastYearMonth=${lastYear}_${lastMonth} # ## Step through dates/schools # for yearMonth in $thisYearMonth $lastYearMonth do year=$(echo $yearMonth | awk -F_ '{print $1}') month=$(echo $yearMonth | awk -F_ '{print $2}') while read line do site=$(echo $line | awk '{print $1}') resolution=$(echo $line | awk '{print $2}') datatype=$(echo $line | awk '{print $3}') /home/thmsoc/lphilpotts_stuff/intermagnet_test/wget_intermagnet_gmag_test.ksh $site $year $month $resolution $datatype #echo "$site $year $month $resolution $datatype" done < ${CONFIGDIR}/intermagnet_site_list.txt done # ## Clean up # exit 0