ASM #245 logs in caveData need to be purged. Added function to caveUtil, added BASE_LOGDIR in cave.sh and added function call

Change-Id: I41e5e11254fc52e49c4668b2797624c599130c67

Former-commit-id: fad7cf2e6661aa0bcc9c37499e0560b708f192f0
This commit is contained in:
Kevin P. Johnson 2014-03-13 20:42:12 +00:00
parent 7952862443
commit 4c833d3389
2 changed files with 25 additions and 2 deletions

View file

@ -191,13 +191,18 @@ then
PROGRAM_NAME="cave"
fi
LOGDIR="$HOME/caveData/logs/consoleLogs/$hostName/"
BASE_LOGDIR=$HOME/caveData/logs/consoleLogs
LOGDIR=$BASE_LOGDIR/$hostName/
# make sure directory exists
if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
fi
# delete any old disk caches in the background
deleteOldCaveLogs &
curTime=`date +%Y%m%d_%H%M%S`
# At this point fork so that log files can be set up with the process pid and

View file

@ -31,7 +31,7 @@
# fixes for INI files with spaces
# Feb 20, 2014 #2780 bclement added site type ini file check
#
#
# Mar 13 2014 #15348 kjohnson added function to remove logs
source /awips2/cave/iniLookup.sh
@ -305,3 +305,21 @@ function logExitStatus()
fi
fi
}
#Delete old CAVE logs DR 15348
function deleteOldCaveLogs()
{
local curDir=$(pwd)
local mybox=$(hostname)
echo -e "Cleaning consoleLogs: "
echo -e "find $BASE_LOGDIR -type f -name "*.log" -mtime +7 -exec rm {} \;"
find "$BASE_LOGDIR" -type f -name "*.log" -mtime +7 -exec rm {} \;
exit 0
}