Difference between revisions of "Limit the size of .log files & the journal"

imported>Handy
imported>Handy
Line 1: Line 1:
= Introduction =
= Introduction =
Log files & the systemd journal do the same thing in different ways. They keep a record of everything that happens on your computer system. This makes it possible to understand what is going right & what is going wrong. As an example, if your system had been infiltrated by an ssh attack, this could be verified in the log/journal. So these log files are good for more than tracking troublesome hardware, or driver problems, badly written network manager code or the plethora of other problems that the complex & dynamic GNU/Linux system has to deal with.
These logs are an absolute blessing, as not all systems have them, & any server administrators who does have them would be very grateful as they can be the bread & butter of what they do.


Generally only server administrators have use for logs that go back any length of time. Few users who run distros on their desktop, Notebook, Netbook... machines, need to keep such huge log files, histories going back for many months or even years, on their system, are a waste of space & also makes viewing your log files more cumbersome.  
Generally only server administrators have use for logs that go back any length of time. Few users who run distros on their desktop, Notebook, Netbook... machines, need to keep such huge log files, histories going back for many months or even years, on their system, are a waste of space & also makes viewing your log files more cumbersome.  
Line 6: Line 10:
===== The first topic on this page will briefly cover the '''systemd journal''' =====
===== The first topic on this page will briefly cover the '''systemd journal''' =====


The systemd journal has taken the place of log files though it has an option for the standard type log files to be created & maintained in the usual fashion, which is the way that Manjaro is set to use. Unfortunately there are still plenty of bugs in systemd & using the following method for limiting the size of the /var/log/journal/* works for some & not others, it also works more effectively for some & somewhat effectively for others... That should eventually change.
The systemd journal has taken the place of log files though it has an option for the standard type log files to be created & maintained in the usual fashion, which is the way that Manjaro does it. Unfortunately there are still plenty of bugs in systemd & using the method presented below, for limiting the size of the /var/log/journal/* works for some but not for others, it also works more effectively for some & only somewhat effectively for others, meaning it will limit the size of the journal, but not to the limit that you set? As systemd's development continues this problem should eventually change.




===== The second topic will cover handling log files, in some depth =====
===== The second topic will cover handling log files =====


This topic will go into far more in depth, covering the use of the '''logrotate''' command, '''logrotate.conf''', the '''/etc/cron.daily cron.weekly cron.monthly cron.yearly''', some ways to run created scripts, & a mention of the '''crontab''' method of running a script also. I'll try to make this section accessible to as many people as possible, which means this will be a long page.
This topic will go into far more depth, it will covering the use of the '''logrotate''' command, '''logrotate.conf''', the '''/etc/cron.daily cron.weekly cron.monthly cron.yearly''', some ways to run created scripts, & a mention of the '''crontab''' method of running a script also. I'll try to make this section accessible to as many people as possible, which means this will be a long page.


<br clear="all"/>
<br clear="all"/>
Anonymous user