I stopped writing separate maintenance scripts for each Linux distro. You can too.

Published: (January 2, 2026 at 11:02 PM EST)
1 min read
Source: Dev.to

Source: Dev.to

What it does

SYSMAINT is a bash script that unifies system maintenance across Linux distributions. It handles:

  • Package updates and upgrades
  • Log rotation and cache cleanup
  • Old kernel removal
  • Security audits (SSH, firewall, services)
  • JSON telemetry output

The same command works on:

  • Ubuntu, Debian
  • Fedora, RHEL, Rocky, Alma, CentOS
  • Arch Linux, openSUSE

Why dry‑run matters

The feature I’m most proud of is the dry‑run mode.

sudo ./sysmaint --dry-run

This shows you exactly what will change before anything happens—no surprises. You can see which packages will be updated, what files will be cleaned, and which kernels will be removed.

Then run the real command:

sudo ./sysmaint

Automation

Once you’re comfortable, you can automate it.

# Weekly automated maintenance
sudo ./sysmaint --auto --quiet

Or set up a systemd timer:

sudo systemctl enable --now sysmaint.timer

The JSON output makes it easy to integrate with monitoring tools or log aggregation.

Production ready

I’ve been running SYSMAINT in production for months. Here’s what I’ve seen:

  • Average runtime: 3.5 minutes
  • Memory usage: < 50 MB
  • Zero unexpected behavior so far
  • Consistent results across all 9 supported distros

The project has 500+ tests covering edge cases, error handling, and cross‑platform consistency. ShellCheck reports zero errors.

Give it a try

git clone https://github.com/Harery/SYSMAINT.git
cd SYSMAINT
sudo ./sysmaint --dry-run

It’s MIT licensed, with comprehensive documentation and an interactive mode for step‑by‑step exploration.

SYSMAINT on GitHub

Core Capabilities

Back to Blog

Related posts

Read more »

The RGB LED Sidequest 💡

markdown !Jennifer Davishttps://media2.dev.to/dynamic/image/width=50,height=50,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%...

Mendex: Why I Build

Introduction Hello everyone. Today I want to share who I am, what I'm building, and why. Early Career and Burnout I started my career as a developer 17 years a...