ASM #18910 Change CAVE log purging to add check for find commands already running.

Change-Id: I84e168aa8cd3049af189aaa83bec32cad24b39c7

Former-commit-id: 05f1cb8e1b83eeb64f5e3cc3b4ec96f92ff2366a
This commit is contained in:
Ying-Lian.Shi 2016-04-20 18:13:53 +00:00
parent 71a7817241
commit 046c6d6e0d

View file

@ -40,6 +40,9 @@
# Jul 23, 2015 ASM#13849 D. Friedman Use a unique Eclipse configuration directory
# Aug 03, 2015 #4694 dlovely Fixed path for log file cleanup
# Sep 16, 2015 #18041 lshi Purge CAVE logs after 30 days instead of 7
# Apr 20, 2016 #18910 lshi Change CAVE log purging to add check for find commands
# already running
########################
source /awips2/cave/iniLookup.sh
RC=$?
@ -383,11 +386,12 @@ function deleteOldCaveLogs()
local curDir=$(pwd)
local mybox=$(hostname)
echo -e "Cleaning consoleLogs: "
echo -e "find $HOME/$BASE_LOGDIR -type f -name "*.log" -mtime +30 -exec rm {} \;"
find "$HOME/$BASE_LOGDIR" -type f -name "*.log" -mtime +30 -exec rm {} \;
pidof /bin/find > /dev/null
if [[ $? -ne 0 ]] ; then
echo -e "Cleaning consoleLogs: "
echo -e "find $HOME/$BASE_LOGDIR -type f -name "*.log" -mtime +30 | xargs rm "
find "$HOME/$BASE_LOGDIR" -type f -name "*.log" -mtime +30 | xargs rm
fi
exit 0