#!/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 # # NB: it is intended that this script be run on gaia2 as the wget log file formats differ between machines # and wget_intermagnet_gmag relies on information within the log file. # ## 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 # ## 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 site=fcc resolution=second datatype=variation year=2008 for month in 01 02 03 04 05 06 07 08 09 10 11 do # site=$(echo $line | awk '{print $1}') # resolution=$(echo $line | awk '{print $2}') # datatype=$(echo $line | awk '{print $3}') wget_intermagnet_gmag.ksh $site $year $month $resolution $datatype done < ${CONFIGDIR}/intermagnet_site_list.txt # done # ## Clean up # exit 0