Issue #245
Change-Id: I7fca90d9f039b46061bb12a28485c92e21c4fd85 Former-commit-id: e776776d797a80b059f00bd78dd0806b7b0f2241
This commit is contained in:
parent
456e07d8da
commit
75dd01d768
2 changed files with 22 additions and 1 deletions
|
@ -109,13 +109,18 @@ else
|
|||
fi
|
||||
|
||||
hostName=`hostname -s`
|
||||
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 &
|
||||
|
||||
export pid=$$
|
||||
|
||||
curTime=`date +%Y%m%d_%H%M%S`
|
||||
|
|
|
@ -162,3 +162,19 @@ function deleteOldCaveDiskCaches()
|
|||
|
||||
cd $curDir
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue