Omaha #2715 Script to move stats data to new location.
Former-commit-id:b2b00bb763
[formerly29db287a6c
[formerly 74f1e03a7d4458447fad552051af969d2ea71b5e]] Former-commit-id:29db287a6c
Former-commit-id:7714c7c3ac
This commit is contained in:
parent
7f9f516455
commit
0c2d66c29a
1 changed files with 40 additions and 0 deletions
40
deltaScripts/14.4.1/DR2715/move_offline_stats.sh
Executable file
40
deltaScripts/14.4.1/DR2715/move_offline_stats.sh
Executable file
|
@ -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}"
|
Loading…
Add table
Reference in a new issue