/etc/logrotate.conf
Change from "weekly" to "daily".
Use the "rotate" value to set how many days worth of logs you want to keep.
Does the same thing with more flexibility.
Pieter - If you just want to delete the contents of /var/log/messages (as a
one time endeavor), with no backup of the contents, you could do something like:
#cat - > /var/log/messages
^D
The ^D is a <cntrl>D to have cat stop reading from standard input.
Jacob
On Tue, 10 Apr 2001, you wrote:
> 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
--
Jacob Killian
PGTC System Administrator
<mailto: [EMAIL PROTECTED]>
<http://www.pgtc.net>
501-846-7245
"Long may we walk" --my mom
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list