From b2b00bb76312a13325a0fe706e09e664280d09ae Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Wed, 11 Jun 2014 08:49:39 -0500 Subject: [PATCH] Omaha #2715 Script to move stats data to new location. Former-commit-id: 74f1e03a7d4458447fad552051af969d2ea71b5e --- .../14.4.1/DR2715/move_offline_stats.sh | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 deltaScripts/14.4.1/DR2715/move_offline_stats.sh diff --git a/deltaScripts/14.4.1/DR2715/move_offline_stats.sh b/deltaScripts/14.4.1/DR2715/move_offline_stats.sh new file mode 100755 index 0000000000..999e36306f --- /dev/null +++ b/deltaScripts/14.4.1/DR2715/move_offline_stats.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Move offline stat files from localize location to /awips2/edex/data/stats + +. /awips2/edex/bin/setup.env + +oldStatDir=/awips2/edex/data/utility/common_static/configured/${AW_SITE_IDENTIFIER}/stats +newStatParent=/awips2/edex/data + +if [ ! -d ${oldStatDir} ] ; then + echo "ERROR: ${oldStatDir} dirctory does not exist" + echo "FATAL: The update has failed." + exit 1 +fi + +if [ ! -d ${newStatParent} ] ; then + rm -rf ${newStatParent} + mkdir -p ${newStatParent} + if [ $? -ne 0 ] ; then + echo "ERROR: Unable to create ${newStatParent}" + echo "FATAL: The update has failed" + exit 1 + fi +fi + +cp -R -p ${oldStatDir} ${newStatParent} + +if [ $? -ne 0 ] ; then + echo "ERROR: copying ${oldStatDir} to ${newStatParent} failed." + echo "FATAL: The update has failed." + exit 1 +fi + +rm -rf ${oldStatDir} + +if [ $? -ne 0 ] ; then + echo "WARNING: Deleting ${oldStatDir} failed" +fi + +echo "INFO: ${newStatParent}/stats updated from ${oldStatDir}"