[Sunhelp] Scripts

Ana Yuseepi anayuseepi at asia.com
Fri Mar 24 06:18:06 CST 2000


hello all, sorry for the late reply,....

but, the below command, i suspect would work on filenames 
messages.0 or something like that...

#  find /var/adm -type f -name "messages*" -mtime +0 -print -exec rm {} \;

but what i would like is to remove the entry inside the file name messages. as in the per line message entry.. is there a data structure for the /var/adm/messages ?

another approach might be:
edit syslog.conf and instead of /var/adm/messages, change it to:
/var/adm/messages`date +%m%d%y`

thanks everyone... 
-Ana : )

------Original Message------
From: "Leon Halford - Open Systems Solutions Ltd" <leon.halford at opensolutions.co.uk>
To: sunhelp at sunhelp.org
Sent: March 22, 2000 9:54:54 AM GMT
Subject: RE: [Sunhelp] Scripts


Easy answer without scripting:

1. Edit root crontab to run the default newsyslog command everyday.

2. Add a new cron entry similar to this:

   find /var/adm -type f -name "messages*" -mtime +0 -print -exec rm {} \;

   It will mail the root account with the files it deletes each day.

   If you want to suppress the mail redirect the above command to
   /dev/null.


-----Original Message-----
From: sunhelp-admin at sunhelp.org [mailto:sunhelp-admin at sunhelp.org]On
Behalf Of Ana Yuseepi
Sent: 21 March 2000 23:29
To: sunhelp at sunhelp.org
Subject: [Sunhelp] Scripts


hello everyone, can someone give me a short script file that would edit
/var/adm/messages and delete messages earlier than yesterday?

or can anyone give me a referral to mailing lists on script writing?

thanks a lot..
-Ana : )
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup


_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup







More information about the SunHELP mailing list