LSTSRV-L Archives

LISTSERV Site Administrators' Forum

LSTSRV-L

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Gregory Decker <[log in to unmask]>
Fri, 31 May 1996 09:16:33 -0400
text/plain (99 lines)
>
> Yingying Zhou <[log in to unmask]> writes:
> > I'm looking for a script that auto cycles LISTSERV logs.  The LISTSERV is
> > running on  a Unix system.  If  you have a  working one and would like to
> > share it with others, please let me know.
>
As does <[log in to unmask]>:
> I've  written one but it's  too simple and  too system  specific to post --
> it's just like   rotating your syslog  files.   LISTSERV  does its  log  to
> standard  output, and that's redirected into   a file by   'go'.  So once a
> night run a  cron job that  mv's the log file  to some name that you create
> with judicious use of 'date', then kill lsv, then  run 'go' again.  In fact
> I don't think you really  need to kill lsv; the  old one seems to be killed
> off if you run 'go' ... but I haven't checked that, so don't trust me.
>
Here is a script that should work. It is sys V specific because of the ps
command. Change to 'ps -x' for BSD. Sorry about the riot act flotsam. Make
sure that a 'go bg' will work from a cron job on your system. You may have
to comment out some of the goofy stuff in the 'go' script. The paraniod may
wish to add more script checks depending on what you feel is important.
 
        ...Greg
 
-----------------------------------------------------------------------
Gregory Decker
National Institutes of Health/DCRT/NSB
PH:  301-402-4763
FAX: 301-480-6041
EMail: [log in to unmask]
 
-----------------------------------------------------------------------
 
 
#! /bin/sh
# Copyright (c) 1995 Gregory Decker.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1.  Redistributions of source code must retain the above copyright
#     notice, this list of conditions and the following disclaimer.
# 2.  Redistributions in binary form must reproduce the above copyright
#     notice, this list of conditions and the following disclaimer in the
#     documentation and/or other materials provided with the distribution.
# 3.  Gregory Decker shall have no obligation to support, maintain,
#     or update this software.
# 4.  The name of Gregory Decker may not be used to endorse or
#     promote products derived from this software without specific prior
#     written permission.
#
# THIS SOFTWARE IS PROVIDED BY GREGORY DECKER ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GREGORY DECKER BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ------------------------------------------------------------------------------
#
# --- This must be run from the account that owns listserv- not root.
# --- $LOGROOT to where you want the logs to be kept.
#      Check the value of LISTLOG in the "go" script.
# --- $LSVROOT is where lsv is.
# --- LOG is the name of the listserv log file.
#
LOGROOT=XXXXXXXX
LSVROOT=XXXXXXXX
LOG=listserv.log
#
cd $LOGROOT
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.1 && 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
mv $LOG   $LOG.0
cp /dev/null $LOG
chmod 640    $LOG
#
# --- Start and stop lsv
#
for x in `ps -e|grep lsv`
do
kill $x
break
done
sleep 3
cd $LSVROOT
go bg
exit(0)

ATOM RSS1 RSS2