Hi Pieter, you could try something like this,
>/var/log/messages
This would erase the entire logfile, or you could use
something like this, in a shell script
CURRDATE=`/bin/date '+%b %e'`
/bin/cat /var/log/messages|/bin/grep -ve $CURRDATE >/var/log/messages.new
/bin/rm -f /var/log/messages.new
/bin/mv /var/log/messages.new /var/log/messages
This will set the variable CURRDATE with the date you run the script. It
then cats the log file, and only keeps the current days log entries. These
it copies to a new log file. on completion it deletes the old file and
renames the new file to the correct name.
Regards
Enrico
---- Original Message -----
From: "Pieter De Wit" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 10:49 AM
Subject: Clearing /var/log/message(s)
> Hello All,
>
> How do I clear messages in the /var/log/messages file ?
>
> (Did some ipchains rules and this log is _BIG_ :)
>
> Thanks,
>
> Pieter De Wit
>
>
>
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list