OpenSolaris

Printable Version Enter a New Search
Bug ID 5016238
Synopsis nightly should be more conservative in clobbering logs
State 10-Fix Delivered (Fix available in build)
Category:Subcategory consolidation:os-net-tools
Keywords oss-request
Sponsor Mark J Nelson
Submitter ro
Responsible Engineer Suhasini Peddada
Reported Against s10_55
Duplicate Of
Introduced In solaris_8
Commit to Fix snv_82
Fixed In snv_82
Release Fixed solaris_nevada(snv_82)
Related Bugs
Submit Date 18-March-2004
Last Update Date 31-January-2008
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.
Work Around
N/A
Comments
N/A