#! /bin/sh
#
# Copyright(c) 1997, by Sun Microsystems, Inc.
# All rights reserved.
#
#ident @Z%newsyslog 1.3 1997/03/31 SMI
#rotate syslog authwarn authlog 2000/07 KM
#rotate VA monitor.log 2000/10/10 KM
#
LOG=messages
cd /var/adm
if test -s $LOG
then
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
mv $LOG $LOG.0
cp /dev/null $LOG
chmod 644 $LOG
fi
#
# Added syslog and the two auth logs:
# 07/00 KM
#
LOGDIR=/var/log
if test -d $LOGDIR
then
cd $LOGDIR
for LOG in syslog authlog authwarn
do
if test -s $LOG
then
test -f $LOG.6 && mv $LOG.6 $LOG.7
test -f $LOG.5 && mv $LOG.5 $LOG.6
test -f $LOG.4 && mv $LOG.4 $LOG.5
test -f $LOG.3 && mv $LOG.3 $LOG.4
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
test -f $LOG && (mv $LOG $LOG.0 ; cp /dev/null $LOG)
chmod 644 $LOG
fi
done
fi
sleep 40
#
kill -HUP `cat /etc/syslog.pid`
#
# Added Virtual Adrian's monitor.log file -- it is never zero-length,
# so use 'test -f'. Only for boxes running Virtual Adrian, of course:
#
cd /var/adm/sa
LOG=monitor.log
if test -f $LOG
then
/etc/rc2.d/S90va_monitor stop > /dev/null 2>&1
test -f $LOG.6.gz && mv $LOG.6.gz $LOG.7.gz
test -f $LOG.5.gz && mv $LOG.5.gz $LOG.6.gz
test -f $LOG.4.gz && mv $LOG.4.gz $LOG.5.gz
test -f $LOG.3.gz && mv $LOG.3.gz $LOG.4.gz
test -f $LOG.2.gz && mv $LOG.2.gz $LOG.3.gz
test -f $LOG.1.gz && mv $LOG.1.gz $LOG.2.gz
test -f $LOG.0.gz && mv $LOG.0.gz $LOG.1.gz
mv $LOG $LOG.0
/usr/local/bin/gzip $LOG.0
/etc/rc2.d/S90va_monitor start > /dev/null 2>&1
fi
If a search engine dropped you directly into this document, you should go to the index page to find out what you're reading. This document is a record of a project from 1999-2000 -- it is not a current guide to installing any software product.