LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-19-2016, 10:19 AM   #1
tess336
LQ Newbie
 
Registered: Aug 2016
Posts: 5

Rep: Reputation: Disabled
Action to be taken when FS grows fast due to some log files.


What is the best practice when some log files grow very fast and eating away the FS space.

Based on the log file name, in some cases we can use
# cat /dev/null > <logfile> - To initialize to zero.
In this case do I need to refresh the log daemon to start logging in again OR it's starts automatically?

Thanks,
srao01
 
Old 08-19-2016, 10:35 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,245

Rep: Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420
Quote:
Originally Posted by tess336 View Post
Based on the log file name, in some cases we can use
# cat /dev/null > <logfile> - To initialize to zero.
In this case do I need to refresh the log daemon to start logging in again OR it's starts automatically?
If you're going to do things like this and just delete the log file why are you bothering to log in the first place?

You need a proper log and log rotation strategy, decide how often logs need rotated and how long to keep them and then use logrotate to do the rotation and compression.
 
1 members found this post helpful.
Old 08-19-2016, 10:41 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 24,278

Rep: Reputation: 7137Reputation: 7137Reputation: 7137Reputation: 7137Reputation: 7137Reputation: 7137Reputation: 7137Reputation: 7137Reputation: 7137Reputation: 7137Reputation: 7137
Quote:
Originally Posted by tess336 View Post
What is the best practice when some log files grow very fast and eating away the FS space.

Based on the log file name, in some cases we can use
# cat /dev/null > <logfile> - To initialize to zero.
In this case do I need to refresh the log daemon to start logging in again OR it's starts automatically?
You're not deleting the log file, so there's no need to restart the daemon, but I agree with tentenths totally. If you're not going to READ/examine/use the log file, why have it at all??

I'd examine WHAT you're logging, to what level, and adjust it accordingly. I'd also use something to examine those files for error(s)/message(s) that are important to you, and have it notify you. Logrotate is a good program to use, and you can easily write a program/script to compress huge log files down to a MUCH smaller size.
 
1 members found this post helpful.
Old 08-19-2016, 10:50 AM   #4
tess336
LQ Newbie
 
Registered: Aug 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Don't worry about the contents of log, we normally take a backup OR preserve a copy on some other FS before initializing it. The TB0ne first sentence clarified the doubt.

Thanks,
srao01
 
Old 08-19-2016, 01:55 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,415
Blog Entries: 13

Rep: Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511
Quote:
Originally Posted by tess336 View Post
Don't worry about the contents of log, we normally take a backup OR preserve a copy on some other FS before initializing it. The TB0ne first sentence clarified the doubt.

Thanks,
srao01
Well why not just redirect the log to be sent to that other file system in the first place?

Another issue here is your incomplete question. Using the reveal method to ask your question and then adapt based on others' comments is not the best way to approach things.
 
Old 08-19-2016, 02:57 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,420
Blog Entries: 4

Rep: Reputation: 3373Reputation: 3373Reputation: 3373Reputation: 3373Reputation: 3373Reputation: 3373Reputation: 3373Reputation: 3373Reputation: 3373Reputation: 3373Reputation: 3373
logrotate is routinely used to compress log-files and to delete old archives on a rotating basis.

In some situations, e.g. where due to government regulations log-files cannot be destroyed, it is quite common to have "log storage farms," consisting of so-called Network-Attached Storage (NAS) of basically-unlimited size, with daemons that migrate the logs and carefully account for them.

And of course it should go without saying that you should be using LVM = Logical Volume Management to allow any mount-point to spread over multiple physical devices . . .

Last edited by sundialsvcs; 08-19-2016 at 02:59 PM.
 
  


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
LXer: Fast Burst Camera: When Great Action Shots Are Enough LXer Syndicated Linux News 0 09-08-2012 03:41 AM
convert screen.log and putty.log files into linux readable files aksharb Linux - Software 1 03-20-2011 08:16 AM
looking for LOG monitoring tool + action. hugle Linux - Security 1 01-08-2006 05:52 AM
Apache access_log grows too fast HermanTheSheep Linux - Software 3 01-10-2005 12:29 PM
/var/log/mailman/ grows exponentailly ramu_ak Linux - General 0 03-25-2004 01:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration