#!/usr/bin/ksh # # call_aari_gmag_mirror_backfiles.ksh - This script sets the arguments # to the script which downloads AARI gmag data - script to download backfiles # rather than daily automated downloads # # June 11th 2012 lphilpott@igpp.ucla.edu # # NB: it is intended that this script be run on gaia2 as the log file formats differ between machines # and aari_gmag_mirror.ksh 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 # for yearMonth in 2011_05 2011_06 2011_07 2011_08 2011_09 2011_10 2011_11 2011_12 do year=$(echo $yearMonth | awk -F_ '{print $1}') month=$(echo $yearMonth | awk -F_ '{print $2}') /disks/socware/thmsoc_dp_current/src/ksh/aari_gmag_mirror.ksh $year $month done # ## Clean up # exit 0