hi everybody do you know how can i rotate my syslog?, it's getting to large!!
need help
thanks in advance,,
by the way how can i see what is the installed AIX version??
thanks again
what i am trying to say is this, for example the
/var/log/syslog, i want to rotate so i don't need to erase or clear it, so if there is a script in the AIX OS, that permits me to do this:
the actual syslog
syslog
the olds ones
syslog.0
syslog.1
Why don't you create a script to run from the crontab to do it for you on a regular basis, say once a week/month? That way you could have a bit better control as well, and perhaps even introduce some date-stamping of the backup files as well, plus deleting them after a set time period.
Example script below , line 1 and 4 isn't correct, but it will give you an idea how to do it.
DATE=`date %dd%mm%yy` (do a man date to see the correct fmt)
cp /var/log/syslog /var/log/syslog$DATE
>/var/log/syslog
find /var/log/syslog* -mtime 30 exec rm{}; (do a man find)
Hope this will help you
Chris IBM Certified Specialist - MQSeries
Here is a syslog rotation script you could add to the cron.
Cheers
#!/bin/ksh
#
# Rotate syslogs every Sunday at 23:59pm
#
# Paul Sharpe
#
#--------------------------------------------------------------------#
# Rotating syslog. #
#--------------------------------------------------------------------#
LOGDIR=/var/log
LOG=syslog
if test -d $LOGDIR
then
cd $LOGDIR
if test -s $LOG
then
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
mv $LOG $LOG.0
cp /dev/null $LOG
chmod 644 $LOG
sleep 40
fi
fi
# Refresh syslogd
kill -HUP `cat /etc/syslog.pid`
PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.