LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-20-2006, 11:52 AM   #1
Steve50
Member
 
Registered: Nov 2004
Location: Coventry, UK
Distribution: Debian Lenny, Ubuntu Feisty
Posts: 121

Rep: Reputation: 15
/var/log/messages query


After a recent problem with my system the /var/log/messages file became very large. The problem is now fixed but is there a way to clear the file safely and start again?
 
Old 10-20-2006, 12:06 PM   #2
Okie
Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 964

Rep: Reputation: 34
i occasionally delete all the files in /var/log and switch to init 1 and then back to init 3 or 4 and those files will be rebuilt,

DO NOT delete any of the sub directories in /var/log (only the log files)
 
Old 10-20-2006, 12:09 PM   #3
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 30
The 'standard' logs, the ones that come with your default Slackware installation, rotate themselves every week I believe. Check root's cronjobs.

Anyway, that's a neat trick Okie, I didn't know about it. Thanks for sharing it
 
Old 10-20-2006, 12:17 PM   #4
Steve50
Member
 
Registered: Nov 2004
Location: Coventry, UK
Distribution: Debian Lenny, Ubuntu Feisty
Posts: 121

Original Poster
Rep: Reputation: 15
Thanks for the replies. Just before I received them, and after much googling, I found that this command clears the log:

cat /dev/null > /var/log/messages

After rebooting everything seems fine, and I've freed up well over 1gb of space.
 
Old 10-20-2006, 01:48 PM   #5
Sonneteer
Member
 
Registered: May 2006
Location: Canada
Distribution: Slackware 13.37; Ubuntu 12.04
Posts: 81
Blog Entries: 5

Rep: Reputation: 15
/etc/logrotate.d/syslog includes /var/log/messages, so that file should get rotated every week, if your computer is on when the daily cron jobs are scheduled to run.
 
Old 10-20-2006, 01:52 PM   #6
Steve50
Member
 
Registered: Nov 2004
Location: Coventry, UK
Distribution: Debian Lenny, Ubuntu Feisty
Posts: 121

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Sonneteer
/etc/logrotate.d/syslog includes /var/log/messages, so that file should get rotated every week, if your computer is on when the daily cron jobs are scheduled to run.
Thanks for this, useful to know.
 
Old 10-21-2006, 05:04 AM   #7
pkn
LQ Newbie
 
Registered: Oct 2006
Location: Netherlands
Distribution: Slackware, CentOS and FC
Posts: 12

Rep: Reputation: 0
[shivers]Horror... throwing away log files.[/shivers]

LogRotate can be run manually from the prompt with an -f switch telling it to force rotation. I do not know if it is there by default, but I make it a point to compress the log files after rotation... less will decompress them on the fly anyway.... and compressed they take up little space.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 07:39 PM
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 05:03 PM
From where am i getting error messages to /var/log/messages? prabhuacsp Linux - Networking 1 02-16-2005 01:34 AM
/var/log/messages full of these messages. Should I be concerned? mdavis Linux - Security 5 04-16-2004 11:08 AM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 09:38 PM


All times are GMT -5. The time now is 05:44 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration