LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-04-2013, 01:55 PM   #1
LittleMaster
Member
 
Registered: Jun 2012
Posts: 98
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, 02:07 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,588

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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, 02:44 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,466
Blog Entries: 54

Rep: Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899
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.
 
  


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


All times are GMT -5. The time now is 06:25 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