Grok-Pedia

logrotate

logrotate

logrotate is a system utility used in Unix-like operating systems to manage the automatic rotation, compression, removal, and mailing of log files. Each log file treated by logrotate is configured in a configuration file, typically located at /etc/logrotate.conf or within /etc/logrotate.d/ for individual service configurations.

History and Context

logrotate was originally developed to address the issue of log files growing indefinitely, which could consume disk space and make log analysis cumbersome. It has been part of many Linux distributions for decades, with its inception dating back to the early days of Linux:

Functionality

logrotate performs several key functions:

Configuration

The configuration for logrotate is done through plain text files, which define how and when log files should be rotated:

Configuration directives include:

Execution

Typically, logrotate is invoked by cron at regular intervals, as defined in the crontab:


0 0 * * * /usr/sbin/logrotate /etc/logrotate.conf

External Links

Related Topics

Recently Created Pages