Linux logrotate

From NovaOrdis Knowledge Base
Revision as of 20:16, 12 February 2018 by Ovidiu (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

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