Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ qmaster Public

Backup tool for multiple projects and MySQL databases with web dashboard and Claude Code cleanup

License

Notifications You must be signed in to change notification settings

imisic/qmaster

Repository files navigation

Quartermaster

Backup tool for people who juggle multiple projects and databases but don't want to think about backups at 2 AM.

I manage several web projects and MySQL databases, and my "backup strategy" used to be vibes and hope. No clear overview of what was backed up, when, or whether the backups even worked. So I built Quartermaster - one place to handle projects, databases, git history, retention, and cleanup, with a dashboard so I can actually see what's going on.

The name? I wanted a system that handles backups and maintenance at least quarterly - those things you keep putting off. Quarterly became Quartermaster became qmaster.

Built with Claude Code. I'm not a developer - I'm a product/telecom guy who wanted to solve a real problem and see what Claude Code can do. The full story is at the bottom.

What It Does

Backup everything, track everything

Full and incremental project backups, MySQL dumps with encrypted passwords, git savepoints and bundles. Every backup gets a SHA256 checksum and metadata file. Retention policies clean up old stuff automatically so you don't drown in archives.

Run it from the CLI or the web dashboard - whichever fits the moment.

Dashboard

Claude Code cleanup

If you use Claude Code, you've probably noticed .claude directories quietly eating your disk space across every project. File history, debug logs, old binaries, plugin caches - it adds up fast.

Quartermaster scans all your projects, shows exactly what's piling up, and lets you clean by category or nuke everything at once. I built this after Claude Code started getting noticeably slower on my machine - turned out I had over 500 MB of stale .claude data scattered across projects. File history, old binaries, debug logs, plugin caches. Once I cleaned it up, the difference was immediate.

Claude Config Cleanup

The full list

  • Project backups - Full and incremental tar.gz archives
  • Database backups - MySQL/MariaDB dumps, compressed, passwords encrypted at rest
  • Git integration - Savepoints, portable bundles, commit history
  • Web dashboard - Streamlit UI for managing everything visually
  • CLI - For when you'd rather type (or you're SSH'd in)
  • Smart startup - Dashboard detects and runs overdue backups in the background
  • Retention policies - Hourly/daily/weekly/monthly tiers, auto-cleanup
  • Checksum verification - SHA256 on everything
  • Secondary sync - Push backups to a NAS, external drive, whatever's mounted
  • Scheduled backups - Cron integration
  • Storage analytics - See what's eating space, get cleanup suggestions
  • Log viewer - Apache and PHP log parsing built in
  • Claude Code cleanup - Find and clean .claude directories across all projects

Quick Start

# Clone
git clone https://github.com/imisic/qmaster.git
cd qmaster

# Setup (creates venv, installs deps, copies example configs)
./setup.sh

# Configure
nano config/settings.yaml     # Storage paths, defaults
nano config/projects.yaml     # Your projects
nano config/databases.yaml    # Your databases (passwords auto-encrypt on first run)

# Go
./run.sh                      # Web dashboard at http://localhost:8501
./run.sh status               # Or use the CLI
./run.sh backup --all

Heads up: The dashboard has no auth. It's meant for localhost. Don't expose it to the internet without a reverse proxy and authentication in front of it.

CLI Essentials

./run.sh backup --all                         # Backup all projects
./run.sh backup --project my-website -i       # Incremental backup
./run.sh backup-db --all                      # Backup all databases
./run.sh snapshot my-website -m "before refactor"  # Git + project + DB in one shot

./run.sh restore my-website backup.tar.gz     # Restore project
./run.sh restore-db my_app_db backup.sql.gz   # Restore database

./run.sh status                               # What's going on
./run.sh verify --project my-website --all    # Check checksums
./run.sh cleanup --dry-run                    # Preview what would be deleted
./run.sh storage --detailed                   # Disk usage breakdown

Configuration

All config files live in config/ and are gitignored. Only .example templates are tracked.

Projects (config/projects.yaml) - path, type, exclusions, git tracking, schedule. Projects can also be auto-discovered from a parent directory.

Databases (config/databases.yaml) - connection details. Put passwords in plain text - Quartermaster encrypts them with Fernet on first load and replaces them with enc: values. The encryption key is stored with 0600 permissions, gitignored.

Settings (config/settings.yaml) - storage paths, retention tiers, timeouts, dashboard config.

Settings reference
Setting Default What it does
storage.local_base ~/backups/qm Where backups go
storage.secondary_sync (none) Optional second location (NAS, external drive)
defaults.project.schedule daily Default backup schedule
defaults.project.retention_days 30 How long to keep project backups
defaults.database.retention_days 14 How long to keep database backups
system.max_parallel_backups 4 Concurrent backup jobs
web.port 8501 Dashboard port

Works On

Linux and Windows via WSL (both tested). macOS should work but hasn't been tested - Apache log paths may need manual config.

Needs: Python 3.10+, mysqldump, git, cron.

Screenshots

More screenshots

Projects

Projects

Databases

Databases

Storage & Cleanup

Storage & Cleanup

Logs & Diagnostics

Logs & Diagnostics

Security details
  • Database passwords encrypted at rest (Fernet: AES-128 in CBC mode with HMAC-SHA256)
  • Encryption key stored with 0600 permissions, gitignored
  • MySQL credentials passed via temp config files, not command line args
  • Backup files created with 0600 permissions
  • Tar extraction has path traversal protection
  • All subprocess calls use list format (no shell injection)

How This Got Made

I started small. I wanted a way to check Apache logs without digging through the terminal. Then I needed proper backups. Then database backups. Then a way to clean up Claude Code config files that were eating disk space. One thing led to another.

The whole project was built with Claude Code. I'm not a developer - I'm a product/telecom guy who wanted to see what Claude Code can actually do when you throw a real problem at it. Turns out, quite a lot. I described what I needed, we iterated, and it kept growing from there.

Fair warning: when I started this, I barely understood git. I'm talking "what do you mean I have to stage before I commit?" levels of confusion. Branches, pull requests, rebasing - might as well have been in Latin. I still wouldn't call myself fluent, but building this project was probably the most effective git tutorial I never signed up for.

I can't promise it handles every edge case perfectly. It works for my setup: a handful of PHP and Python projects on WSL with MySQL databases. But the code is here, and if you find it useful, great.

Bug reports and feature suggestions are welcome. See CONTRIBUTING.md for details.

License

MIT - see LICENSE.

About

Backup tool for multiple projects and MySQL databases with web dashboard and Claude Code cleanup

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published