[HPADM] RE: Sys Log



Prashun,

Maybe can this example script helps you :

#! /bin/sh
#
# Copyright(c) 1997, by Sun Microsystems, Inc.
# All rights reserved.
#
#ident @Z%newsyslog 1.3 97/03/31 SMI
#
LOG=messages
cd /var/adm
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
#
LOGDIR=/var/adm
LOG=syslog
if test -d $LOGDIR
then
cd $LOGDIR
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
mv $LOG $LOG.0
cp /dev/null $LOG
chmod 644 $LOG
sleep 40
fi
fi
#
kill -HUP `cat /etc/syslog.pid`

With regards,

Rein van Klompenburg
The Netherlands

-----Original Message-----
From: hpux-admin-owner@xxxxxxxxxxxxx [mailto:hpux-admin-owner@xxxxxxxxxxxxx]On Behalf Of Prashun Gupta
Sent: donderdag 15 juni 2006 07:28
To: hpux-admin@xxxxxxxxxxxxx
Subject: [HPADM] Sys Log


Hello,

I want to configure my system such as I get syslog in /var/adm/syslog as follows

syslog.log.7
syslog.log.6

syslog.log.5
syslog.log.4
syslog.log.3
syslog.log.2
syslog.log.1
syslog.log

i.,e my total logs should be eight which includes one latest and 7 old ones. I am not able to do its configurations. Any help will be appreicated.

Thanks
Prashun Gupta


De informatie verzonden met dit e-mailbericht (en bijlagen) is uitsluitend bestemd voor de geadresseerde(n) en zij die van de geadresseerde(n) toestemming kregen dit bericht te lezen. Gebruik door anderen dan geadresseerde(n) is verboden. De informatie in dit e-mailbericht (en bijlagen) kan vertrouwelijk van aard zijn en kan binnen het bereik vallen van een geheimhoudingsplicht en een verschoningsrecht.



Relevant Pages

  • Re: best way to distribute an item to everyones homedir?
    ... chmod and chown to change the permissions as you want them to be changed. ... How I do something like this is to build the script one line at a time using ...
    (freebsd-questions)
  • Re: rmdir and chmod - I dont agree with you Steven!!!
    ... Chmod *should not* work, but it does somthing (I have no problems after ... and rmdir has been a DOS command since MS-DOS v2 - ... directory that I made with the script x, ...
    (comp.lang.php)
  • Re: need help with a chmod script in korn shell
    ... >>list of paths from a file to check to see if I am allowed to chmod the ... Script is owned by the group in question. ... This would be 'invoker' rights. ... checks the users privileges when running chmod. ...
    (comp.unix.shell)
  • Re: Mac: Perl script that will run when double-clicked
    ... You need to chmod +x the script, ... What do you consider the purpose of making a perl script clickable? ... The idea here is that I'm going to have downloadable files that the ...
    (comp.lang.perl.misc)
  • Re: Making A File Executable
    ... >Hey Babs, ... >Then just make sure the file is marked executable with chmod for whoever ... Generally you can add executable privilege to a shell script with the ...
    (linux.redhat.misc)