awips2/deltaScripts/13.4.1/resetNtransTable.sh
Steve Harris 3a21a9eb6c 13.5.2-4 baseline
Former-commit-id: 3d0b711ccf [formerly 595e7bc0d9] [formerly e3c935d48b] [formerly 3d0b711ccf [formerly 595e7bc0d9] [formerly e3c935d48b] [formerly 58c6821427 [formerly e3c935d48b [formerly da631849bc9eaaa5c83c2393520b6099413107a5]]]]
Former-commit-id: 58c6821427
Former-commit-id: a8201afb82 [formerly 4c6790f10f] [formerly 1a01e9adff02825a5599659ed7c17823430819bc [formerly abed443b59]]
Former-commit-id: d4668ee6901a6bb072be3a88eaad320aed699c0f [formerly e2398f74e5]
Former-commit-id: 609926f1f4
2013-09-12 11:13:59 -04:00

34 lines
892 B
Bash

#!/bin/bash
# This script will drop the ntrans table and remove the ntrans hdf5 files.
#
# This update needs to be performed when going from build 13.3.1 to build 13.4.1 (or 13.5.1).
#
PSQL="/awips2/psql/bin/psql"
SQL_COMMAND="DROP TABLE IF EXISTS ntrans; UPDATE plugin_info SET initialized='false' WHERE name='ntrans';"
if [ ! -f ${PSQL} ]; then
echo "ERROR: The PSQL executable does not exist - ${PSQL}."
echo "FATAL: Updated Failed!"
exit 1
fi
echo ""
echo "Press Enter to perform the updates Ctrl-C to quit."
read done
echo "INFO: Dropping the metadata ntrans table."
${PSQL} -U awips -d metadata -c "${SQL_COMMAND}"
if [ $? -ne 0 ]; then
echo "FATAL: Updated Failed!"
exit 1
fi
echo "INFO: Purging ntrans hdf5 files."
if [ -d /awips2/edex/data/hdf5/ntrans ]; then
rm -rfv /awips2/edex/data/hdf5/ntrans
fi
echo "INFO: The update was successfully applied."
exit 0