Linux logrotate: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 13: Line 13:
logrotate is a tool that is run periodically - by default, daily - by cron. Every tine it is executed, logrotate reads its configuration files and manages log files declared in those configuration files, according to the specified rules.  
logrotate is a tool that is run periodically - by default, daily - by cron. Every tine it is executed, logrotate reads its configuration files and manages log files declared in those configuration files, according to the specified rules.  


A log rotation consists in renaming the current log fie, so my.log becomes my.log.1, my.log.1 becomes my.log.2 and so forth, and setting up a new my.log log file. The number of log entries to be retained is specified in the configuration. Additional operations like compression may be specified.
A log rotation consists in renaming the current log fie, so my.log becomes my.log.1, my.log.1 becomes my.log.2 and so forth, and setting up a new my.log log file. The number of log files to be retained is specified in the configuration. Additional operations like compression may be specified.


=Installation=
=Installation=

Revision as of 20:16, 12 February 2018

External

Internal

Overview

logrotate is a tool that is run periodically - by default, daily - by cron. Every tine it is executed, logrotate reads its configuration files and manages log files declared in those configuration files, according to the specified rules.

A log rotation consists in renaming the current log fie, so my.log becomes my.log.1, my.log.1 becomes my.log.2 and so forth, and setting up a new my.log log file. The number of log files to be retained is specified in the configuration. Additional operations like compression may be specified.

Installation

yum install -y logrotate

Footprint

./usr/sbin/logrotate
./etc/logrotate.d
./etc/cron.daily/logrotate
./etc/logrotate.conf
./etc/rwtab.d/logrotate
./var/lib/logrotate