How to clear/reset syslog?

Craig White craigwhite at azapple.com
Thu Feb 4 17:54:43 MST 2010


On Thu, 2010-02-04 at 14:09 -0700, joe at actionline.com wrote:
> The /var/log/syslog on my system got really large and cluttered up with a
> new entry being added every minute for several days due to a "stuck"
> printer (which I finally got corrected).  So I tried to restart the system
> logger to clear out all the excess clutter and start over, but the command
> to do that FAILS.  So is it okay to just delete the /var/log/syslog and
> /var/log/message files to get a fresh start?
> 
> In addition to 'restart' (which FAILED), I also tried 'stop' and 'start'
> (both of which work, although 'start' also returns a "FAILED" response
> (which I don't understand).
> 
> In any case, if anyone would care to review the steps I've tried and the
> results, I've posted a 65 line recap at the following link:
> 
> http://www.upquick.com/linux/restart.logger.txt
> 
> But my question is just this: Is there any problem or reason why I should
> not just delete those two bloated log files?
> 
> Or, is there some other (better) way to clear out all the superfluous
> excess in those log files?
----
as root...

> /var/log/messages

which is shorthand for, echo "" > /var/log/messages

or whichever file you want to empty.

Done

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the PLUG-discuss mailing list