?
Solved

how to clean log files at  /var/log directory

Posted on 2003-02-20
5
Medium Priority
?
311 Views
Last Modified: 2008-02-01
I'm running out disk space on my linux box, my var/log/wtmp keep growing how i can clean up this file and some log files to free up, i'm often getting error because of this. Can any body help me. What should I do, do i have to remove this file or clean up the logs.
Thanks
0
Comment
Question by:burn2fre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 18

Expert Comment

by:liddler
ID: 7986457
cat /dev/null > /var/log/wtmp
will set it back to 0 bytes, don't delete it as the system writes to it.
You may also have a /var/log/utmp, if that's also big do the same
0
 
LVL 1

Expert Comment

by:MikaelEriksson
ID: 7987048
To save more space you may also want to delete or archive away all the old log files. E.g. /var/log/messages.1, messages.2 ...
0
 
LVL 7

Expert Comment

by:sppalser
ID: 7987726
As a side note to the above suggestions you should be in single user mode when you  zero out utmp & wtmp then do a reboot following so as to avoid possible corruption of these files.  Corrupt utmp & wtmp files are usually not fatal but can cause some minor issues.  You may also want to check the /var/spool directory and sub-directories for files that have grown.  Some unices keep mail files there and those can get quite large if no one checks their mail.  

Good Luck.
0
 
LVL 2

Expert Comment

by:Renots
ID: 9402443
burn2fre,

No comment has been added lately (213 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question
is:

to be PAQ'd, with points forfeited.

Please leave any comments here within the next SEVEN days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Renots
EE Cleanup Volunteer
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 9446589
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question