mirror of
https://github.com/Misterblue/opensim-docker.git
synced 2026-07-30 19:32:56 +00:00
23 lines
517 B
Bash
Executable File
23 lines
517 B
Bash
Executable File
#! /bin/bash
|
|
# Clean out old log files in the log directory.
|
|
# Does not delete saved log directories.
|
|
|
|
OPENSIMHOME=${OPENSIMHOME:-/home/opensim}
|
|
|
|
TIMEAGO=${OPENSIMHOME}/.lastLogCleanup
|
|
|
|
LOGDIR="${OPENSIMHOME}/logs"
|
|
if [[ -d "$LOGDIR" ]] ; then
|
|
rm -f "$TIMEAGO"
|
|
touch --date="-1 hours" "$TIMEAGO"
|
|
|
|
cd "$LOGDIR"
|
|
for file in phys*.log scene-*.log ; do
|
|
if [[ -e "$file" ]] ; then
|
|
if [[ $TIMEAGO -nt "$file" ]] ; then
|
|
rm -f "$file"
|
|
fi
|
|
fi
|
|
done
|
|
fi
|