Skip to content

07 Log Cleanup Scenarios and Labs

Brayan Marin Guirales edited this page Aug 19, 2026 · 1 revision

Log Cleanup - Scenarios & Interactive Labs 🧪


🚀 Production Scenarios

  1. High-Traffic Nginx Access Log Purging: Daily cron job purging uncompressed access logs older than 14 days to prevent root partition disk exhaustion.
  2. Windows Server IIS Application Pool Retention: Scheduled task pruning recursive nested request logs in C:\inetpub\logs\LogFiles older than 30 days.
  3. Database Dump Rotation: Purging database dumps older than 7 days exceeding 50 MB in size.
  4. CI/CD Runner Workspace Pruning: Cleaning build workspaces on self-hosted runners to prevent No space left on device errors.

🧪 Interactive Hands-on Labs

Lab Guide Focus Area Key Concepts
Lab 1: Basic Retention & Dry-Run Preview Simulation & Pruning Setting up mock directories, running simulation mode (-n), and executing live deletions.
Lab 2: Recursive Traversal & Size Filtering Advanced Filtering Multi-tiered microservice folders, flat vs. recursive scans, and minimum size filters (-m).
Lab 3: Production Scheduling & Audit Logging Production Automation Linux Cron, Windows Task Scheduler, ISO-8601 audit logging, and exit code validation.

Clone this wiki locally