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: 1ecf65586c [formerly c791f55d02] [formerly e3a951da78] [formerly e3a951da78 [formerly b2797a0788]] [formerly 1ecf65586c [formerly c791f55d02] [formerly e3a951da78] [formerly e3a951da78 [formerly b2797a0788]] [formerly 4c833d3389 [formerly e3a951da78 [formerly b2797a0788] [formerly 4c833d3389 [formerly fad7cf2e6661aa0bcc9c37499e0560b708f192f0]]]]]
Former-commit-id: 4c833d3389
Former-commit-id: 5670c4f921 [formerly 54316530e4] [formerly 32b372db4b] [formerly 7d143cb8bb502681f18dbc02b91eaf8ec1347e0a [formerly 6cd2437734cdee7992443a141d1ae3334e20f72d] [formerly 32b372db4b [formerly 17a4229072]]]
Former-commit-id: 8071520181000346d1946928d68d3f98fb868d7c [formerly 692a687b6edde3278b185df9e4ad90705444abee] [formerly 90a9e642e3 [formerly eb12ec9c14]]
Former-commit-id: 90a9e642e3
Former-commit-id: fd16da4ae4
This commit is contained in:
Kevin P. Johnson 2014-03-13 20:42:12 +00:00
parent d878399b42
commit 19af3e23fa
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
}