#!/usr/bin/ksh # # gbo_step_atha_mirror_batch.ksh - Calls the main mirror script # for STEP Polar mag data collected at University Athabasca # # Based heavily of gbo_uc_rmd_mirror_batch.ksh by Tim Quinn # # # ## 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} for yearMonth in $thisYearMonth $lastYearMonth do for site in fsj ftn hrp lcl lrg pks whs do year=$(echo $yearMonth | awk -F_ '{print $1}') month=$(echo $yearMonth | awk -F_ '{print $2}') gbo_atha_step_mirror.ksh $site $year $month done done # ## Cleanup # exit 0