Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-14-2006, 05:36 AM   #1
Registered: Nov 2006
Location: UK
Distribution: Mandriva 2007
Posts: 93

Rep: Reputation: 15
Question /var/log how do I control my logs?

I have /var as a partion. I notice the partion is filling as logs are created, obviously. How do I control this? Do I just delete them or do I access the files and erase them? no at all sure???

Example syslog do I

rm syslog

or do I open in editor and delete text and leave file intact?

If I do remove syslog does it just regenerate? Do I do this with all logs? Dont want to break my linux!

here is my df for logs:

/dev/hdb8 1.1G 825M 231M 79% /var

here is my log directory

./ btmp dmesg lastlog news/ security.log user.log Xorg.9.log.old
../ clamav/ drakbackup lpr/ prcsys.log spooler wtmp
acpid cron/ explanations mail/ scrollkeeper.log syslog Xorg.0.log
auth.log cups/ kdm.log messages secure syslog~ Xorg.0.log.old
boot.log daemons/ kernel/ messages~ security/ syslog~~ Xorg.9.log

Thanks in advance.
Old 12-14-2006, 06:26 AM   #2
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 756

Rep: Reputation: 144Reputation: 144
You didn't say which Linux distro you are using, but regardless, you very likely have a package named logrotate installed. It takes care of compressing old logs and deleting older logs to take care of this very problem.

If your /var partition is too small, you may want to edit /etc/logrotate.conf and change the line that says
rotate 4
rotate 3
or similar. This line determines how many weeks of logs are kept. Also, be sure that the line that says
is uncommented so that old logs are compressed.

To learn more, see the command
man logrotate

Those logs can be crucially valuable to figuring out why something doesn't work, so it's unwise to delete them earlier than necessary. It's interesting to note how many people post questions on sites like this without first looking at their logs.
Old 12-14-2006, 03:44 PM   #3
Registered: Nov 2006
Location: UK
Distribution: Mandriva 2007
Posts: 93

Original Poster
Rep: Reputation: 15
Thanks for that. I will try when I get home.

Im running Mandriva 2007. I guessed there probably was an automated tool. To my mind it would of made sense to of had it in the 'Configure your computer > System > check logs' menu.

Anyway thanks for that.


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
Opennms Logs - where are web.log, web_rtc.log and webauth.log referenced? not_much_of_a_guru Linux - Networking 0 07-12-2006 11:28 AM
my /var/log/syslog only logs the last 12 hours or so ALInux Linux - General 4 02-11-2006 11:53 AM
Can I delete all logs in /var/log? HURRY! Tenover Linux - General 4 01-03-2006 02:09 PM
strange logs in /var/log/messages dominant Linux - Security 1 04-21-2004 01:12 PM
How to control log file size in /var/log? yan Linux - General 2 10-13-2003 06:00 PM > Forums > Linux Forums > Linux - Newbie

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

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