
Line 10 indicates that only 4 weeks’ worth of log files are backed up after which older ones will be purged or removed to create more disk space.Line 7 indicates that the root user and the adm group own the log files.$ cat /etc/nfįrom the configuration shown, the /etc/nf file rotates log files on a weekly basis as indicated on line 3. Let’s have a look at the configuration file. More notably, it uses an ‘ include‘ directive for pulling configurations located in the ‘ /etc/logrotate.d‘ directory.

It contains default settings and facilitates log rotation for non-system package logs. etc/nf – This is the main configuration file for the logrotate tool. There are two main configuration sources that you need to pay close attention to: Logrotate runs daily as a cron job, going through various log files, rotating them, and purging older log files as defined in the configuration file.
#Linux logtail norwap install
By default, logrotate comes preinstalled in modern Linux distributions and hence no need to install it. Run below command to check logrotate version, :~$ logrotate -versionĭefault state file path: /var/lib/logrotate/statusįrom the output, we can clearly see that we have logrotate version 3.14.0. To do that, issue the command:įor Debian / Ubuntu System: $ sudo apt-get install logrotate -yįor CentOS / RHEL / Fedora System: $ sudo yum install logrotate -y How logrotate utility worksīefore we examine the workings of the logrotate utility, ensure that logrotate is installed on your system. Log rotation is usually activated when the size of log files grows and exceeds a certain limit.


#Linux logtail norwap free
This is a tool that facilitates the rotation of log files and archival & removal of old ones to free up disk space. The log rotation process is facilitated using a utility called logrotate. Older log files are usually compressed and appear as apport.log.2.gz, apport.log.3.gz, apport.log.4.gz, and so on. For example, apport.log becomes apport.log.1 and a new apport.log log file is created to log new log entries. Log rotation is a process that creates new log files and archives & removes old ones to save on disk space. And this is where the log rotation comes in. With that in mind, it becomes prudent to keep the log files to a manageable size and delete old log entries that hog precious disk space. Before you even know it, the log files will have ballooned in size, gobbling up much of your hard drive space, and if you are not careful, you can easily run out of disk space. Over time, as additional information gets logged, the log files increase in size and take up more space on your hard drive.
