#!/usr/bin/ksh # # call_aari_gmag_mirror.ksh - This script sets the arguments # to the script which downloads AARI gmag data # # June 8th 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 . /home/thmsoc/lphilpotts_stuff/aari_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 # for yearMonth in $thisYearMonth $lastYearMonth do year=$(echo $yearMonth | awk -F_ '{print $1}') month=$(echo $yearMonth | awk -F_ '{print $2}') aari_gmag_mirror.ksh $year $month done # ## Clean up # exit 0