๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout 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.

Related Terms

Inode
A data structure in Unix filesystems that stores metadata about a file, excluding its name and data.
Crontab Syntax
The time specification format used in cron job scheduling, with five fields defining minute, hour, day of month, month, and day of week.
Systemd
A system and service manager for Linux that initializes the system and manages services, logging, and more.
File Permissions
A security mechanism that controls who can read, write, or execute files and directories in Unix-like systems.
RAID
Redundant Array of Independent Disks โ€” a technology combining multiple physical drives into a single unit for performance, redundancy, or both.
Dmesg
A command that displays kernel ring buffer messages, useful for diagnosing hardware and driver issues.
View All Linux Terms โ†’