#!/usr/bin/env sh #### UNIX Script Documentation Block # # Script Name: JNWM_DBNLOG #### date export PS4=' $SECONDS + ' set -xa ########################## # Specify NET and RUN Name ########################## export NET=${NET:-nwm} export RUN=${RUN:-nwm} export cycle=${cycle:-t${cyc}z} ######################################################## # Make working directory and file To Log Msgs ######################################################## export DATA=${DATA:-${DATAROOT:?}/${jobid}} if [ ! -e $DATA ]; then mkdir -p $DATA fi cd ${DATA} ################################### # Set up the PDY ################################### setpdy.sh . ./PDY #################################### # Determine Job Output Name on System #################################### export pgmout="OUTPUT.${job}_${PDY}${cyc}.$$" export COMIN=${COMIN:-$(compath.py ${envir}/$NET/${nwm_ver})/${RUN}.${PDY}} export COMOUT=${COMOUT:-$(compath.py -o $NET/${nwm_ver})/${RUN}.${PDY}} for file in `find $COMIN/. -name *.dbnlog` do cat $file >>para_alerts.txt.raw done cat para_alerts.txt.raw |sort -u >para_alerts.txt cpfs para_alerts.txt $COMOUT msg="JOB $job HAS COMPLETED NORMALLY." postmsg $pgmout "$msg" if [ -e $pgmout ]; then cat $pgmout fi if [ "$KEEPDATA" != YES ]; then echo "rm -rf $DATA" fi date