PerlintermediatedevopsAI generated

Automated Log Rotation and Archival Tool

Build a log-management tool that finds log files past a size or age threshold, compresses them, archives them into dated folders, and prunes archives older than a retention window. Learners practice filesystem traversal, compression with Compress::Zlib, and building a tool suitable for cron-driven automation.

Estimate
~7.5h
Steps
5
Completed by
0
Proposed by
codeseed.app

File::Find · Compress::Zlib

Project roadmap

  1. 01

    Find rotation candidates

    ~1.5h

    Traverse a log directory and identify files exceeding a configured size or age threshold.

  2. 02

    Implement compression

    ~2h

    Compress qualifying files using Compress::Zlib and write them to a dated archive folder.

  3. 03

    Implement retention pruning

    ~1.5h

    Delete archived files older than a configured retention period.

  4. 04

    Add configuration and dry-run

    ~1.5h

    Support a config file for thresholds/paths and a dry-run mode for previewing actions.

  5. 05

    Add logging and cron integration

    ~1h

    Log every action taken and document a crontab entry for scheduled execution.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~7.5h · 5 steps

Tech stack

File::FindCompress::Zlib