Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

logrotate is a program which is scheduled (usually nightly or weekly) to archive log files by renaming them with a suffix so that the applications writing the log files start writing to new (empty) files.

Traditionally, a numbering system is used when renaming the log files: the most recent log file is renamed by having the .1 suffix appended to it, the second most recent file has .2 appended to it, etc. When the maximum number of archived log files is reached, the oldest log file (with the highest number) is deleted and the suffix of each successive log file is incremented, resulting in the “rotation” of the log files.

The archived log files can optionally be compressed to conserve disk space and some implementations of logrotate use date-based suffixes rather than numbers when renaming the log files.

history | excerpt history