Automated Package Updates β’ System Cleanup β’ Security Auditing β’ Performance Optimization
Supports Ubuntu, Debian, Fedora, RHEL, Rocky, Alma, CentOS, Arch, openSUSE
- Quick Start
- Product Requirements
- Why SYSMAINT
- Features
- Platform Support
- Installation
- Usage
- Automation
- Documentation
- Quality Metrics
- Contributing
- License
# Clone the repository
git clone https://github.com/Harery/SYSMAINT.git
cd SYSMAINT
# Make executable
chmod +x sysmaint
# Preview changes (100% safe, read-only)
sudo ./sysmaint --dry-run
# Execute maintenance
sudo ./sysmaintOr use Docker:
docker run --rm --privileged ghcr.io/harery/sysmaint:latestThe SYSMAINT product requirements document (PRD) defines the vision, requirements, and roadmap for the project.
π View Product Requirements (PRD)
- Multi-Distro Support - Single tool supporting 9+ Linux distributions
- Safe Operation - Dry-run mode for previewing all changes
- Audit Trail - JSON output for compliance and monitoring
- Automation Ready - Systemd timers, cron jobs, Docker/Kubernetes support
- Enterprise Grade - Comprehensive testing (500+ tests), security scanning
Linux system maintenance is fragmented across distributions, each with different package managers, cleanup procedures, and security practices. SYSMAINT unifiesθΏδΈε into a single, production-ready tool.
| Feature | SYSMAINT | Traditional Scripts |
|---|---|---|
| 9 Distros | β One tool | β Multiple scripts |
| Safety | β Dry-run mode | β Risky execution |
| Audit Trail | β JSON output | β No logging |
| Interactive | β TUI menu | β CLI only |
| Tests | β 500+ tests | β None |
| Speed | β‘ <3.5 min avg | π Variable |
graph LR
A[sysmaint] --> B[Package Management]
A --> C[System Cleanup]
A --> D[Security Auditing]
A --> E[Performance Optimization]
B --> B1[apt/dnf/pacman/zypper]
B --> B2[snap packages]
B --> B3[flatpak packages]
C --> C1[Log rotation]
C --> C2[Cache cleanup]
C --> C3[Old kernel removal]
D --> D1[SSH configuration]
D --> D2[Firewall status]
D --> D3[Service validation]
E --> E1[Disk recovery reporting]
E --> E2[JSON telemetry]
| Module | Description | Benefit |
|---|---|---|
| Package Management | Automated updates, upgrades, and cleanup | Keeps software current & secure |
| System Cleanup | Removes logs, caches, temp files, old kernels | Recovers disk space |
| Security Auditing | Checks permissions, services, and repos | Identifies vulnerabilities |
| JSON Telemetry | Structured output for monitoring | Enables automation |
| Dry-Run Mode | Preview all changes safely | Zero-risk testing |
| Interactive TUI | User-friendly dialog-based menu | Easy for beginners |
| Distribution | Versions | Package Manager | Status |
|---|---|---|---|
| Ubuntu | 22.04, 24.04 | apt |
β LTS |
| Debian | 12, 13 | apt |
β Stable |
| Fedora | 41 | dnf |
β Latest |
| RHEL | 9, 10 | dnf/yum |
β Enterprise |
| Rocky Linux | 9, 10 | dnf/yum |
β Enterprise |
| AlmaLinux | 9, 10 | dnf/yum |
β Enterprise |
| CentOS | 9 Stream | dnf/yum |
β Stream |
| Arch Linux | Rolling | pacman |
β Tested |
| openSUSE | Tumbleweed | zypper |
β Tested |
git clone https://github.com/Harery/SYSMAINT.git
cd SYSMAINT
chmod +x sysmaint
sudo ./sysmaint --dry-runcurl -O https://raw.githubusercontent.com/Harery/SYSMAINT/main/sysmaint
chmod +x sysmaint
sudo ./sysmaint --dry-rundocker pull ghcr.io/harery/sysmaint:latest
docker run --rm --privileged ghcr.io/harery/sysmaint:latestAvailable Docker Images:
| Image | Description |
|---|---|
ghcr.io/harery/sysmaint:latest |
Latest stable release |
ghcr.io/harery/sysmaint:v1.0.0 |
Version pinned |
ghcr.io/harery/sysmaint:ubuntu |
Ubuntu-based variant |
ghcr.io/harery/sysmaint:debian |
Debian-based variant |
ghcr.io/harery/sysmaint:fedora |
Fedora-based variant |
Multi-architecture: linux/amd64, linux/arm64
π³ Full Docker Guide: docs/DOCKER.md
# Install to system path
sudo install -Dm755 sysmaint /usr/local/sbin/sysmaint
# Enable automated maintenance
sudo install -Dm644 packaging/systemd/sysmaint.{service,timer} /etc/systemd/system/
sudo systemctl enable --now sysmaint.timerπ Full Installation Guide: docs/INSTALLATION.md
sudo ./sysmaint --guiLaunches an interactive terminal menu (TUI) for guided operation.
sudo ./sysmaint --autoRuns all maintenance operations without prompts.
# Package management only
sudo ./sysmaint --upgrade
# Cleanup only
sudo ./sysmaint --cleanup
# Remove old kernels
sudo ./sysmaint --purge-kernels
# Security audit only
sudo ./sysmaint --security-auditsudo ./sysmaint --json-summary | jq .sudo ./sysmaint --auto --quiet| Option | Description |
|---|---|
--dry-run |
Preview changes without executing |
--gui |
Interactive TUI menu |
--auto |
Non-interactive automated mode |
--upgrade |
Update all packages |
--cleanup |
Clean caches and temp files |
--purge-kernels |
Remove old kernel packages |
--security-audit |
Run security checks |
--json-summary |
Output results in JSON format |
--verbose |
Detailed logging output |
--quiet |
Minimal output only |
# Install service files
sudo install -Dm755 sysmaint /usr/local/sbin/sysmaint
sudo install -Dm644 packaging/systemd/sysmaint.{service,timer} /etc/systemd/system/
# Enable weekly automatic maintenance
sudo systemctl enable --now sysmaint.timer
# Check status
sudo systemctl status sysmaint.timer# Edit crontab
crontab -e
# Add weekly maintenance (Sundays at 2 AM)
0 2 * * 0 /usr/local/sbin/sysmaint --auto --quietservices:
sysmaint:
image: ghcr.io/harery/sysmaint:latest
privileged: true
volumes:
- /:/host:ro
# Override command as needed
# command: ["--auto", "--quiet"]apiVersion: batch/v1
kind: CronJob
metadata:
name: sysmaint
spec:
schedule: "0 2 * * 0" # Weekly at 2 AM
jobTemplate:
spec:
template:
spec:
containers:
- name: sysmaint
image: ghcr.io/harery/sysmaint:latest
securityContext:
privileged: true
restartPolicy: OnFailure| Metric | Value | Status |
|---|---|---|
| Test Coverage | 500+ tests across 14 suites | β |
| Code Quality | ShellCheck: 0 errors | β |
| Runtime | <3.5 minutes average | β |
| Memory Usage | <50 MB | β |
| Platform Support | 9 distributions tested | β |
| Container Images | Multi-arch (amd64/arm64) | β |
SYSMAINT is built with security-first principles:
- β Input Validation β All parameters sanitized
- β Least Privilege β Minimal sudo requirements
- β Audit Trail β JSON output for compliance
- β No External Calls β Zero network dependencies
- β ShellCheck Verified β Static analysis passed
- β Vulnerability Scanning β CI/CD integrated
π Security Policy: docs/SECURITY.md
SYSMAINT includes 500+ tests covering all supported Linux distributions with automated testing in both local Docker and GitHub Actions.
# Quick validation on current system
./tests/quick_test.sh
# Test specific OS in Docker
./tests/test_single_os.sh ubuntu 24.04
# Validate before PR submission
./tests/validate_pr.sh| Category | Suites | Tests |
|---|---|---|
| Smoke Tests | Basic functionality | 10+ |
| OS Family | Debian, RedHat, Arch, SUSE, Fedora, Cross-OS | 80+ |
| Execution Modes | --auto, --gui, --dry-run, --quiet, --verbose, --json | 20+ |
| Features | Packages, cleanup, security, firmware | 60+ |
| Security | Permissions, GPG, SELinux/AppArmor | 40+ |
| Edge Cases | Failures, network issues, permissions | 30+ |
| Integration | systemd, cron, Docker, services | 30+ |
| Docker | Container-specific tests | 40+ |
| GitHub Actions | CI/CD environment tests | 50+ |
| Performance | Benchmarks | 15+ |
| TOTAL | 14 Suites | 500+ |
Test across all supported OS locally:
# Single OS
./tests/run_local_docker_tests.sh --os ubuntu-24
# Multiple OS (parallel)
./tests/run_local_docker_tests.sh --os ubuntu-24,debian-12,fedora-41 --parallel
# Full test suite
./tests/full_test.sh --profile full --parallel- Automatic: Runs on every push and pull request
- Matrix: Tests all 14 OS versions in parallel
- Fast: Smoke tests complete in ~5 minutes per OS
# Trigger manual CI run
gh workflow run test-matrix.yml -f test_profile=smoke -f os_filter=ubuntu-24
# Download CI results
gh run download --name test-results-ubuntu-24Compare local Docker vs GitHub Actions results to identify discrepancies:
# Run both and compare
./tests/run_dual_environment_tests.sh --os ubuntu --version 24.04
# Compare existing results
./tests/report_discrepancies.sh --results tests/resultsMetrics:
- Pass Rate: Tests passed percentage
- Congruence: Environment similarity (0-100%)
- Accuracy Score: Overall consistency measure
| Document | Description |
|---|---|
| Test Dashboard | Interactive test results visualization |
| Test Quick Start | Get started in 5 minutes |
| Test Guide | Comprehensive testing guide |
| Test Cheatsheet | Quick command reference |
| Test Matrix | Complete 500+ test inventory |
| Test Summary | Infrastructure overview |
| Test Architecture | Test structure & design |
| Test Troubleshooting | Common issues & solutions |
| Contributing Tests | Contribution guide |
| OS Support | OS compatibility matrix |
| Performance Baselines | Performance targets & metrics |
| Status Assessment | Project completion status |
| Executive Summary | Executive overview |
| Document | Description |
|---|---|
| Product Requirements (PRD) | Product vision, requirements & roadmap |
| Project Structure | Directory organization & file layout |
| Library Modules | Core library documentation |
| Utility Scripts | Development & CI/CD scripts |
| Installation Guide | All installation methods |
| Troubleshooting | Common issues & solutions |
| Architecture | System design & components |
| Performance | Benchmarks by OS |
| Security | Security policy & best practices |
| Contributing | Development guidelines |
| Code of Conduct | Community guidelines |
We welcome contributions from the community! Please see our contributing guidelines:
- Contributing Guide β Development workflow & standards
- Code of Conduct β Community guidelines
MIT Β© 2025 Mohamed Elharery
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
If you find SYSMAINT useful, please consider giving it a star! β
| Resource | Link |
|---|---|
| Website | https://www.harery.com |
| Repository | https://github.com/Harery/SYSMAINT |
| Documentation | https://github.com/Harery/SYSMAINT/tree/main/docs |
| Issue Tracker | https://github.com/Harery/SYSMAINT/issues |
| Discussions | https://github.com/Harery/SYSMAINT/discussions |
| Releases | https://github.com/Harery/SYSMAINT/releases |
| Docker Image | https://ghcr.io/harery/sysmaint |
Built with β€οΈ for the Linux ecosystem
GitHub β’ Documentation β’ Support β’ Discussions