Re: [Networker] large messages file
2007-05-10 22:43:34
Duross, Theresa (DET) wrote:
> What can be done to decrease the size of my nsr/logs/messages file on the
> server? Can it be safely deleted? I am running Networker 6.1.3build428
> Network Edition.
>
You could run a script to tidy up your messages and daemon.log files. I
have one that you could use - I run it weekly from cron.
#!/bin/ksh
# rotate_nw_logs
# Rotate NetWorker logs 1.4
[ -z "$(ps -ef | grep /nsrd | grep -v grep)" ] && exit
umask 022
LOGDIR=/nsr/logs
typeset -Z3 MAXVERS MAXVERSPLUS1
# value below needs to be the same as the value of MAXVERS set in
/etc/init.d/networker
MAXVERS=12
let MAXVERS-=1
cd $LOGDIR
while [ $MAXVERS -gt 0 ]; do
let MAXVERSPLUS1=$MAXVERS+1
[ -f messages.$MAXVERS ] && mv messages.$MAXVERS \
messages.$MAXVERSPLUS1
[ -f daemon.$MAXVERS ] && mv daemon.$MAXVERS \
daemon.$MAXVERSPLUS1
[ -f summary.$MAXVERS ] && mv summary.$MAXVERS \
summary.$MAXVERSPLUS1
chmod 644 daemon.*
let MAXVERS-=1
done
mv messages messages.001
[ -f summary ] && mv summary summary.001
> messages
kill -1 $(cat /etc/syslog.pid)
cp -p daemon.log daemon.001
> daemon.log
To sign off this list, send email to listserv AT listserv.temple DOT edu and
type "signoff networker" in the body of the email. Please write to
networker-request AT listserv.temple DOT edu if you have any problems with this
list. You can access the archives at
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
|
|
|