#!/usr/bin/ksh # # call_wget_lrv_gmag.ksh - This script sets the arguments # to the script which downloads gmag data from the site LRV (Leirvogur) # # April 30 2012 lphilpott@igpp.ucla.edu # Based heavily on: call_wget_intermagnet_gmag.ksh # # NB: it is intended that this script be run on gaia2 as the wget log file formats differ between machines # and wget_lrv_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 . ~/lphilpotts_stuff/lrv_wget_test/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 lastYear=$(( $thisYear - 1 )) for year in $thisYear $lastYear do wget_lrv_gmag.ksh $year done else wget_lrv_gmag.ksh $thisYear fi # ## Clean up # exit 0 # DRAFT ROUTINE CURRENTLY SET UP TO DOWNLOAD TO MY TEST FOLDERS # PATHS WILL NEED TO BE CHANGED BEFORE MOVING TO PRODUCTION