Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 02-04-2013, 02:55 PM   #1
Registered: Jun 2012
Posts: 100
Blog Entries: 1

Rep: Reputation: Disabled
/var Filesystem reached 100 %

Hi All,
Lots more time /var filesystem reached 100 %. To resolve i had Mistaking deleted messsages log .Which caused the message log not getting reflected after message log getting deleted.I have already enable log rotate for everyday .Before log are getting rotated /var filesystem getting filled up .Please advise how to clear logs without affecting running Application.

cp -p /var/log/messages /opt/log/backup/messages_05022013

whether nullifing the log cause harm to running Application.

cat /dev/null /var/log/messages
Old 02-04-2013, 03:07 PM   #2
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 413Reputation: 413Reputation: 413Reputation: 413Reputation: 413
Emptying the messages file wont harm your apps, it could cause an error if you have a lock on the file, say you have it open in vim, while an app tries to write to it. Depending upon the app it may just sit in a "FUTEX_WAIT" status until its available or error out completely.

How big is your /var/ filesystem? This seems very odd to me that your log files are filling up this quickly. Do you have any of your apps set in a more verbose logging, for instance, is Apache or MySQL in the "debug" log mode?
Old 02-04-2013, 03:44 PM   #3
Registered: May 2001
Posts: 28,886
Blog Entries: 55

Rep: Reputation: 3356Reputation: 3356Reputation: 3356Reputation: 3356Reputation: 3356Reputation: 3356Reputation: 3356Reputation: 3356Reputation: 3356Reputation: 3356Reputation: 3356
Even worse, with a file open for writing on the file descriptor space won't be reclaimed even if a file is deleted. Making a daemon close and re-open its open files by sending the process a -HUP is then often the preferred method as you can see in /etc/logrotate.d/ scripts. While on the subject of rotating log files, if there's space or other constraints, it's also perfectly possible to rotate specific logs multiple times a day or let rotation be triggered by say a max size threshold.


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
root filesystem reached 93%, need to free the space, help needed..please.. redhat70 Linux - Server 9 10-04-2012 10:53 PM
[SOLVED] Ubuntu 10.04 installation:never reached 100% queeniegdb Linux - Laptop and Netbook 1 09-11-2010 11:25 AM
var filesystem 100% can't login, need help acascianelli Red Hat 6 02-17-2009 09:47 PM
/var is at 100% usage, even after deleting files WindowBreaker Slackware 6 09-10-2006 09:17 AM
Solaris 9 /var directory is at 100% rust8y Solaris / OpenSolaris 4 05-05-2006 06:54 PM

All times are GMT -5. The time now is 05:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration