awips2/javaUtilities/hydro/ohd.pdc_pp/scripts/run_pdc_pp
Bryan Kowal c407dd8623 Issue #2021 - relocate all Java hydro projects from nativeLib to a sub-directory within javaUtilities
Former-commit-id: 360e0f61f8580cfca1e8dd307e920e9e0150016d
2013-06-03 11:05:21 -05:00

38 lines
No EOL
1 KiB
Bash

#!/bin/ksh
# File name: run_pdc_pp
# This allows you to run this script from outside of ./bin
RUN_FROM_DIR=`dirname $0`
# set up SOME environment variables for WHFS applications
. $RUN_FROM_DIR/../../set_hydro_env
export CONNECTION_STRING=$JDBCURL
#export CONNECTION_STRING=jdbc:postgresql://lx1-nhdr:5432/hd_ob6rhax?user=oper
#get java dir
export SYS_JAVA_DIR=$($GAD_DIR/get_apps_defaults$OS_SUFFIX sys_java_dir)
export SYS_JAVA_BIN_DIR=$SYS_JAVA_DIR/bin
#truncate the preprocessor log
export LOGFILE=$PDC_PP_LOG_DIR/PDCPreprocessor.log
export LOGFILE_TMP=$PDC_PP_LOG_DIR/PDCPreprocessor.tmp
tail -12000 $LOGFILE > $LOGFILE_TMP
mv $LOGFILE_TMP $LOGFILE
# set java classpath
export CLASSPATH=$DB_DRIVER_PATH:$WHFS_BIN_DIR/pdc_pp.jar
AMIRUNNING_DIR=$PDC_PP_LOG_DIR
. /awips/hydroapps/public/bin/amirunning
if [[ $AmIRunning = "yes" ]]
then
echo Startup cancelled because of prior running instance >> $LOGFILE
exit 1
fi
#Execute the PDC Preprocessor
$SYS_JAVA_BIN_DIR/java ohd.hseb.pdc_pp.PDCPreprocessor $CONNECTION_STRING $1 >>$LOGFILE 2>&1
exit