logrotate

Configures and triggers log file rotation, compression, and cleanup via logrotate.

6|1|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/L3DigitalNet/Claude-Code-Plugins --skill logrotate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logrotate
Source: https://github.com/L3DigitalNet/Claude-Code-Plugins/tree/main/plugins/linux-sysadmin/skills/logrotate
Command: npx skills add https://github.com/L3DigitalNet/Claude-Code-Plugins --skill logrotate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill manages the rotation, compression, and cleanup of log files, preventing disk space exhaustion and ensuring logs remain accessible and organized.

Core Features & Use Cases

  • Automated Rotation: Configures and triggers log file rotation based on size, age, or other criteria.
  • Compression & Archiving: Compresses old log files to save space and manages their retention.
  • Post-rotation Scripts: Executes commands after rotation, such as signaling applications to reopen log files.
  • Use Case: Ensure your web server logs don't fill up your disk by automatically rotating and compressing them daily, keeping only the last 30 days of logs.

Quick Start

Use the logrotate skill to test the configuration of the nginx logrotate configuration file.

Frequently Asked Questions about logrotate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate log file rotation to prevent disk space exhaustion on Linux?

Automate log file rotation by configuring the logrotate utility to trigger based on size or age, compressing old logs, and defining retention policies to prevent disk space exhaustion on Linux systems.

How does postrotation script execution work for reopening application log files?

Postrotation script execution works by running specified commands immediately after log rotation, such as signaling an application like nginx to reopen log files and resume writing without service interruption.

What is the best way to manage log archiving and compression for system services?

The best way to manage log archiving is using logrotate to compress old log files automatically, saving disk space while maintaining organized, accessible archives for system services and applications.

Can I schedule log rotation using systemd timers instead of cron?

Yes, you can schedule log rotation using systemd timers or cron. Both methods trigger the logrotate utility to execute configuration files at defined intervals for routine log management.

Does logrotate work with nginx web server logs?

Yes, logrotate works with nginx logs. You can test and apply logrotate configuration files to nginx to automatically rotate, compress, and manage web server log retention daily.

Why do I need to understand logrotate configuration syntax to manage disk space?

Understanding logrotate configuration syntax is required to define rotation criteria, compression rules, and retention limits accurately, ensuring logs are managed properly and disk space is controlled.