#!/usr/bin/ksh # # gen_probe_l1_list.ksh # # This script will generate a file listing what l1 # cdfs have been produced ## 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/gaia2_test/soc_it_to_me.config # ## Start creating file list # rm -f ${LOCAL}/probe_l1_availability.txt printf '\n\t\t\t\t\t\t >>>>> Probe Level 1 Data Availability <<<<<\n\t\t\t\t\t\t\t%s\n\n' "`date`" >> ${LOCAL}/probe_l1_availability.txt ## Process sites # currentdate=$(date -u '+%Y%m%d') oldday=NaN for date in $(cat ${CONFIGDIR}/date_list.txt) do if (( $date < 20070201 )) then continue fi if [[ $date = $currentdate ]] then ## Rename temporary file # mv -f ${LOCAL}/probe_l1_availability.txt ${FILELISTS}/probe_l1_availability.txt exit 0 fi newday=$(echo $date | awk '{print substr($1,7,2)}') if [[ $newday != $oldday ]] then printf "\n=================================================================================================================================================================================================================\n" >> ${LOCAL}/probe_l1_availability.txt printf "Date |PID|" >> ${LOCAL}/probe_l1_availability.txt for dtype in $(cat ${CONFIGDIR}/probe_l1_list.txt) do printf "%-6s|" $dtype >> ${LOCAL}/probe_l1_availability.txt done printf "\n=================================================================================================================================================================================================================\n" >> ${LOCAL}/probe_l1_availability.txt oldday=$newday fi for probe in $(cat ${CONFIGDIR}/probe_list.txt) do printf "%s|%s|" $date $probe>> ${LOCAL}/probe_l1_availability.txt for dtype in $(cat ${CONFIGDIR}/probe_l1_list.txt) do check=$(grep $date ${FILELISTS}/${probe}_l1_list_${dtype}.txt) if [[ -z $check ]] then check= else check=X fi printf "%6s|" $check >> ${LOCAL}/probe_l1_availability.txt done printf "\n-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" >> ${LOCAL}/probe_l1_availability.txt done done # ## Rename temporary file # mv -f ${LOCAL}/probe_l1_availability.txt ${FILELISTS}/probe_l1_availability.txt # ## Cleanup # exit 0