emacs w#!/usr/bin/ksh # # call_wget_usgs_gmag.ksh - This script sets the arguments # to the script which downloads usgs 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 2011_10 do year=$(echo $yearMonth | awk -F_ '{print $1}') month=$(echo $yearMonth | awk -F_ '{print $2}') # Add any more sites to the list here. for site in bou do wget_usgs_gmag.ksh $site $year $month done done # ## Clean up # exit 0