Linux logrotate
Jump to navigation
Jump to search
External
- https://www.networkworld.com/article/3218728/linux/how-log-rotation-works-with-logrotate.html
- https://linux.die.net/man/8/logrotate
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 there, 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.
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