LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-08-2007, 02:34 PM   #1
markraem
Member
 
Registered: Nov 2003
Posts: 82

Rep: Reputation: 15
how to clear /varlog/messages ?


Hello,

What do I have to do when I want to clear the /var/log/messages file in linux ?

Is it safe to simply remove it and then touch it again ?

Thanks in advance
 
Old 12-08-2007, 02:43 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I use logrotate for this - as far as I know it's available with most distros. You can configure it to rotate logs based on age or size as choose many versions to keep.

I haven't tried it but I'd expect that if you removed it and touched it, you'd have to restart syslogd
 
Old 12-08-2007, 04:34 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by gilead
I haven't tried it but I'd expect that if you removed it and touched it, you'd have to restart syslogd
That's affirmative. e.g. On my CentOS 5 box, the logrotate 'postrotate' directive that handles /var/log/messages does exactly that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Two short and clear messages from Germany to Steve B. LXer Syndicated Linux News 0 03-02-2007 06:01 PM
How to clear a std::string buff.clear()? lucky6969b Programming 3 03-17-2006 07:50 AM
how do i replace the clear "clear screen" with the cls command thefedexguy SUSE / openSUSE 2 12-02-2005 05:02 PM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 06:39 PM
can not clear log file messages mitch_lin Red Hat 2 04-25-2004 08:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration