[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]

Re: Log rotating?

John R. Jackson jrj@gandalf.cc.purdue.edu
Fri, 28 Jun 2002 10:37:20 -0700 (PDT)


>Just a quick question: does conserver rotate any of its own logs, or should 
>we use our own log rotating scripts?

It does not roll its own.

I store my "live" log files in /var/adm/consoles/current.  I run the
attached cs.swap script at the start of each month.  It creates a new
archive area (/var/adm/consoles/archive/YYYY-MM-DD) and renames the live
log files into the archive area.  Then it pre-creates each new log file
with a little message that the swap happened (and showing a timestamp
of when the log file begins):

  +++ console1.cc.purdue.edu console log swap: 2002-06-01 08:12:21

Then it HUP's conserver to cause it to switch to the new files.  Finally,
it goes through the archived files and appends a message like the above
to show when the file was terminated, and then it gzip's them.

Like most of my script coding, you can set the DEBUG environment variable
to "print" (or "echo") as you run the script to see what it would do:

  DEBUG=print cs.log console log swap

In other words, make sure you test this before running it for real.  I
don't trust my own code.  You shouldn't either :-).

>Bruce Z. Lysik

John R. Jackson, Technical Software Specialist, jrj@purdue.edu

cs.log

cs.swap