Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
finottiOffline
Post subject: log file sizes  PostPosted: 16.05.2014, 20:13



Joined: 2010-09-12
Posts: 325

Status: Offline
Dear all,

I've just notices that some of my log files are huge. (I'm in a tight SSD, so I am trying to free some space.)

kern.log.1 and messages.1 have 1.3GB each...

Is this normal? Is it possible to reduce their sizes?

Thanks,

Luis
 
 View user's profile Send private message  
Reply with quote Back to top
spockOffline
Post subject: RE: log file sizes  PostPosted: 16.05.2014, 21:57



Joined: 2010-09-11
Posts: 80
Location: Near Milton Keynes, UK
Status: Offline
Is this happening on your new system and you've just noticed, or on a mature system that was otherwise running OK for some months?

What about /var/log/messages and /var/log/kern.log - are they big too? Are they growing rapidly? I once had a USB hub that was spewing hundreds of messages per second, which caused log files to very soon become that big. You can check with "tail /var/log/kern.log" which will print the last ten lines from the end of the file. Or "tail -n 20 /var/log/kern.log" will give you the last twenty lines, or "head -n 30 /var/log/kern.log" will give you the first thirty, etc. Examine the contents of the files - does anything appear lots of times? Try it again in a few minutes and compare.

My kern.log is only 788K, last updated just now when I booted up, and kern.log.1 is 368K, last updated five days ago. I believe the system rotates the logs automatically (either every so often, or when they grow big enough - I'm not sure which but probably the former judging from your issue) so that kern.log becomes kern.log.1 and kern.log.1 becomes kern.log.2.gz (which is gzip compressed to save space). But I may need correcting here. I may also be wrong in my belief that nothing too bad will happen if you delete these gigantic log files, as I had to do with my runaway system threatening me with "No space left on device" errors. I don't think they're crucial for anything except curious sysadmins wanting to examine what happened. But if you do, maybe at least recreate blank files with "touch /var/log/kern.log.1" or whatever, just so the automatic rotation process has something to go on. Thinking back, I seem to recall manually editing out all the unwanted error messages by piping each log file through grep, or something, once I'd disconnected the offending USB hub. Before you attempt any of this though it's probably wise to wait and check for someone else's (wiser) advice first, unless of course the log files are eating up your entire computer syst



[NO CARRIER]
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
slhOffline
Post subject: RE: log file sizes  PostPosted: 16.05.2014, 21:58



Joined: 2010-08-25
Posts: 761

Status: Offline
The logrotate package should keep it in line.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: log file sizes  PostPosted: 17.05.2014, 11:46



Joined: 2010-09-12
Posts: 325

Status: Offline
Thanks for the replies.

@spock: it is an old installation. Looking at head and tail outputs, I see no sign of a message that appears constantly... I gzipped them for now.

@slh: I have the latest logrotate installed...

My other system has the same files with only 48KB...
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio