|
Description
|
The nightly script when it finishes creates a subdirectory
to place the various log files. The code it
uses is:
LLOG="$ATLOG/log.`date '+%m%d'`"
rm -rf $ATLOG/log.??`date '+%d'`
if [ -f $LLOG -o -d $LLOG ]; then
LLOG=$LLOG.$$
fi
mkdir $LLOG
This has two negative effects:
1) Rerunning nightly more than once in a day clobbers
your past log files.
2) Rerunning nightly clobbers all log files from
the same day in all past months.
While this may be desireable in some environments,
it is too restrictive for general usage.
Moving Note 1 from Comments:
Possible ways to fix this:
1) Allow the setting of LLOG in the environment
file and only use the current algorithim if it
isn't set.
2) Just delete the rm -rf line of code and let the
user clean up after themselves. The checking for
existence of LLOG and adding $$ will protect conflicts
3) Do both.
I added a Suggested Fix from Rainer Orth. It accounts for #2 above, but not for #1. In addition, it increases the granularity of the LLOG setting to YYYY-MM-DD-HH:MM:SS, rather than simply YYYY-MM-DD.
Just to clarify:
Portions of the code changes are contributed by Rainer. Please refer to the updated suggested fix and evaluation section for additional code changes provided.
|