Day 045 / DevOps / Capacity

Log Rotation Planner

View source ↗Scroll to explore ↓
Log Rotation Planner project cover
/ Overview

A dependency-free Python CLI that estimates retained log storage, modeled rotation peak and budget headroom from explicit assumptions.

NameLog Rotation Planner

ClientIndependent daily build

IndustriesInfrastructure and reliability tooling

DateDay 045 · October 14, 2026

/ Challenge

Rotation and retention settings consume storage together. A small planning tool can make the assumptions and expected headroom visible before an operator chooses settings.

/ Provided services

Clear thinking.
Practical delivery.

01

Capacity estimates

Separates active and retained archive storage using explicit decimal-MB assumptions.

02

Retention visibility

Reports the effective archive days after rounding to whole rotation intervals.

03

Budget review

Compares the modeled peak against a budget and emits an exit code for review.

Log Rotation Planner feature visual
/ Solution

Log Rotation Planner combines assumed constant daily growth, whole-day rotation intervals, requested archive retention and a compression ratio. It rounds archive count up, reports effective retention, adds active storage and one extra raw interval for a modeled peak, then compares that peak with a supplied budget. It does not read logs or change services, and actual bursts, overhead or rotation behavior may exceed the estimate.

/ Impact

Whole-interval archive count

Effective retention reporting

Archive-only compression model

Steady and modeled peak storage

Budget headroom and status

Finite-number and bounded input validation

Text and JSON output

Ten standard-library tests

/ Tech stack

Python standard library

Argparse, math and JSON provide the complete dependency-free CLI.

Explicit model

Constant growth, archive compression and a raw rotation-overlap allowance are documented assumptions rather than measured guarantees.

Unittest

Ten tests cover arithmetic, rounding, compression, budget boundaries, invalid numbers and CLI JSON output.

Next project

Service Health Board

View case study ↗