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
- 01
Find rotation candidates
~1.5hTraverse a log directory and identify files exceeding a configured size or age threshold.
- 02
Implement compression
~2hCompress qualifying files using Compress::Zlib and write them to a dated archive folder.
- 03
Implement retention pruning
~1.5hDelete archived files older than a configured retention period.
- 04
Add configuration and dry-run
~1.5hSupport a config file for thresholds/paths and a dry-run mode for previewing actions.
- 05
Add logging and cron integration
~1hLog 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.
Tech stack