- 论坛徽章:
- 2
|
# more /usr/lib/newsyslog\r\n\r\n#! /bin/sh\r\n#\r\n# Copyright(c) 1997, by Sun Microsystems, Inc.\r\n# All rights reserved.\r\n#\r\n#ident @Z%newsyslog 1.3 97/03/31 SMI\r\n#\r\nLOG=messages\r\ncd /var/adm\r\ntest -f $LOG.2 && mv $LOG.2 $LOG.3\r\ntest -f $LOG.1 && mv $LOG.1 $LOG.2\r\ntest -f $LOG.0 && mv $LOG.0 $LOG.1\r\nmv $LOG $LOG.0\r\ncp /dev/null $LOG\r\nchmod 644 $LOG\r\n#\r\nLOGDIR=/var/log\r\nLOG=syslog\r\nif test -d $LOGDIR\r\nthen\r\n cd $LOGDIR\r\n if test -s $LOG\r\n then\r\n test -f $LOG.6 && mv $LOG.6 $LOG.7\r\n test -f $LOG.5 && mv $LOG.5 $LOG.6\r\n test -f $LOG.4 && mv $LOG.4 $LOG.5\r\n test -f $LOG.3 && mv $LOG.3 $LOG.4\r\n test -f $LOG.2 && mv $LOG.2 $LOG.3\r\n test -f $LOG.1 && mv $LOG.1 $LOG.2\r\n test -f $LOG.0 && mv $LOG.0 $LOG.1\r\n mv $LOG $LOG.0\r\n cp /dev/null $LOG\r\n chmod 644 $LOG\r\n sleep 40\r\n fi\r\nfi\r\n#\r\nkill -HUP `cat /etc/syslog.pid` |
|