Prevent my logs from growing so large
I have a Kubuntu install that works fine but for some reason, it grows the logs into hundreds of GBs.
Is there a method to prevent those logs from growing so large? I researched "log rotate" but I couldn't understand it. I would like something established such that after a certain size, the logs are automatically deleted so I don't have to do it manually each time. How would I do so? Here are the logs: #1: /var/log/syslog #2: /var/log/kern.log I already determined I don't need them, so I would like to auto-delete them once they reach a certain size. Thank you. |
Sorry, but you definitely don't want to delete those logs by default.
If you've got those logs growing that large ("hundreds of GBs", hehe...., that's just too funny...) then you definitely want to/must look at the root cause of the problem. I'm sure that once you fix the issue/s your PC will feed you with additional CPU/IO throuput (which will not be busy discarding the hundreds of GBs of output that you're planning to delete). |
Quote:
Quote:
|
Quote:
Forgive my ignorance, but would I really need to retain those logs if this particular desktop is a dedicated "number cruncher"? What I mean is: I donate its cpu and gpu cycles to various online distributed computing projects. That is all I do with this computer. I have a different computer for "my" needs. With that in mind, is it ok to auto delete them by default (i.e., upon a certain size, etc?) Thank you again for your time! |
On a related note - I can't open the logs because they are so large (the computer just freezes and runs out of ram).
Is there some way I can look into those logs to see exactly which program is causing the trouble? |
Quote:
|
Quote:
|
I would suggest you to use another tool to open those files, do not use an editor (more, less, or most can be used, they will not eat up your ram)
|
How about gzip (or similar), followed by recreating an empty file for more logs.
This is basically what logrotate does. |
Quote:
There is more than one main reason:
Summed up: the files syslog and kern.log are extremely important. If the PC writes a lot of stuff into them your PC is basically shouting "help! help!" and if you don't check & fix the problem your PC will die <gloomy music in the background>. :) |
Duplicate post with this one.
I don't think that it's fair to have 2 such posts running in parallel. |
@MBA Whore
I read your other threads and I'm not thrilled. Are you aware of the effort of the persons that write in these forums? |
All times are GMT -5. The time now is 07:02 AM. |