Re: newsyslog naming scheme could be improved?

Michael Maddex <[email protected]> Sat, 11 Oct 2008 16:14:37 -0600
Newsgroups gmane.org.user-groups.nmlug
Message-ID <[email protected]>
A couple of suggestions:  The first one doesn't change the name, but may 
help your co-workers.  Ask them to use a command like
	# zfgrep 'bad thing' /var/log/messages.*.gz
to locate the item in question.

The other idea: Run a bash script after the logs are rotated with a line 
like this in it
	mv messages.1.gz messages.$( date +%F ).gz
If necessary, you could do multiple files with a
	for FILE in LIST ; do
	mv $FILE... ...
	done
type of construction.  The script could also delete the messages files 
older than a specified time.

HTH.

Kelly Jones wrote:
> newsyslog rotates logfiles so that messages.0.gz is yesterday's file,
> messages.1.gz is the day before's, etc.
> 
> This is ugly. If I tell my fellow sysadmins that I ran this command:
> 
> zfgrep 'bad thing' /var/log/messages.4.gz
> 
> and found stuff, they may run it the next day and get different
> results because the file is now messages.5.gz
> 
> Improving my cow-orkers intelligence would be the ideal solution, but
> has anyone considered tweaking newsyslog to name files
> messages.2008-10-05-12-00-00.gz or something. IE, give them a constant
> name that doesn't change and then delete them after how many ever
> days?
> 

-- 

"We are confronted with insurmountable opportunities."
-- Walt Kelly, "Pogo"
_______________________________________________
NMLUG mailing list
[email protected]
http://lists.b9.com/cgi-bin/mailman/listinfo/nmlug