🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Linux Intermediate

What is Logrotate?

A utility that manages automatic rotation, compression, and removal of log files to prevent disk space exhaustion.

Logrotate runs via cron and handles log file management. Configuration in /etc/logrotate.d/ specifies rotation frequency (daily, weekly), retention count, compression, and post-rotation scripts.

Options include size-based rotation, date-based naming, copying vs moving, and custom scripts for restarting services after rotation. Without logrotate, log files would grow indefinitely and fill disk space.