Skip to content

TheBoscoClub/DAS-Backup-Manager

Repository files navigation

DAS Backup Manager

CodeFactor

Version: 0.7.11

DAS backup manager with btrbk integration, SQLite FTS5 content indexing, KDE Plasma GUI with full backup management, D-Bus privilege escalation, and an interactive installer for the full backup pipeline.

Scope

This project manages backups to Direct-Attached Storage (DAS) using the BTRFS filesystem. That's it. That's the scope.

The following are permanently out of scope and will never be added:

  • NAS (Network-Attached Storage)
  • SAN (Storage Area Network)
  • Cloud storage (S3, Azure Blob, GCS, Backblaze, etc.)
  • Any filesystem other than BTRFS (ext4, XFS, ZFS, NTFS, etc.)

This is not a general-purpose backup tool. It is a DAS + BTRFS backup tool. If you need support for other storage architectures or filesystems, you are welcome to write your own application that covers whichever and however many storage backends your heart desires.

That said, suggestions, recommendations, and requests that fall within this narrow scope are very welcome and will be happily entertained.

Features

  • btrbk Backup Orchestration — Nightly incremental BTRFS snapshot backups to DAS enclosure
  • Multi-Target Architecture — Configurable primary, mirror, and ESP-sync roles across any number of DAS drives
  • Boot Subvolume Archival — Archives old boot subvolumes with timestamps (configurable retention)
  • Email Reports — Automated backup status reports with throughput metrics and SMART status
  • ButteredDASD Content Indexer (buttered_dasd library + btrdasd CLI) — Rust library and CLI with SQLite FTS5 database tracking every file across all snapshots
  • Auto-Mount/Unmount — RAII MountGuard resolves target drive serials, auto-mounts BTRFS partitions before operations, and unmounts on completion (all D-Bus methods and CLI commands)
  • D-Bus Privileged Helper (btrdasd-helper) — polkit-authorized daemon with 23 methods for backup, restore, config, schedule, health, and index read operations
  • FFI Bridge (libbuttered_dasd_ffi.so) — C-ABI shared library for GUI access to Rust library functions
  • KDE Plasma GUI (btrdasd-gui) — Native Qt6/KF6 full backup management application with sidebar navigation, Dolphin-style file browser, backup operations, health dashboard, config editor, first-run wizard, desktop notifications, and system tray
  • USB SMART Passthrough — Health queries use -d sat for USB-attached DAS drives to read SMART data through USB-SATA bridges
  • Interactive Installer (btrdasd setup) — 10-step wizard with 5 modes: install, modify, upgrade, uninstall, check
  • Shell Completionsbtrdasd completions generates completions for bash, zsh, fish, elvish, and PowerShell
  • Distro-Agnostic — Supports systemd, sysvinit, and OpenRC init systems
  • Native Packaging — Packaging recipes for Arch (PKGBUILD), Debian/Ubuntu (dpkg), Fedora (RPM), Flatpak, and Snap — all build-tested on their respective distributions before each release

Components

Component Description Status
scripts/backup-run.sh btrbk backup orchestrator with email reporting Active (v3.1.0)
scripts/backup-verify.sh DAS drive health and btrbk status verification Active (v2.0.0)
scripts/boot-archive-cleanup.sh Prune old boot subvolume archives Active (v1.0.0)
scripts/das-partition-drives.sh DAS drive partitioning utility Active (v1.0.0)
scripts/install-backup-timer.sh systemd timer installer Active
config/btrbk.conf Reference btrbk configuration Active
indexer/ ButteredDASD (buttered_dasd lib + btrdasd CLI + btrdasd-helper D-Bus daemon + FFI cdylib) Active (v0.7.0+)
gui/ Qt6/KDE Plasma full backup management GUI (19 C++ components) Active (v0.7.0+)
dbus/ D-Bus system bus configuration and service activation files Active (v0.7.0+)
polkit/ Polkit policy for privilege escalation (7 actions: backup, restore, config, config.read, index, index.read, health) Active (v0.7.0+)

Project Structure

DAS-Backup-Manager/
├── scripts/           # Shell scripts (backup, verify, cleanup, partition)
├── config/            # btrbk.conf, email config template
├── indexer/           # ButteredDASD — Rust library + CLI + D-Bus helper + FFI
│   ├── src/           # Library modules (13): backup, config, db, ffi, health, indexer, mount, progress, report, restore, scanner, schedule, subvol
│   ├── src/setup/     # Binary-only: interactive installer (wizard, templates, detection)
│   ├── src/bin/       # btrdasd-helper D-Bus daemon
│   ├── src/ffi.rs     # C-ABI FFI bridge (extern "C" functions)
│   ├── include/       # C header (btrdasd_ffi.h)
│   └── completions/   # Shell completion installation instructions
├── gui/               # Qt6/KDE Plasma GUI (19 C++ components)
│   └── src/           # MainWindow, Sidebar, DBusClient, panels, dialogs, models
├── dbus/              # D-Bus bus config and service activation
├── polkit/            # Polkit privilege escalation policy
├── packaging/         # Distro packaging (Arch, Debian, Fedora, Flatpak, Snap)
├── docs/              # Architecture, installation, dependencies, recovery, man page
└── CMakeLists.txt     # Build system (BUILD_GUI, BUILD_INDEXER, BUILD_HELPER, BUILD_FFI)

Minimum Requirements

  • Linux with BTRFS support (kernel 5.15+)
  • DAS enclosure (any manufacturer, any interface -- USB, Thunderbolt, eSATA)
  • One or more BTRFS-formatted drives (any technology: HDD, SSD, NVMe)
  • btrbk 0.32+, smartmontools
  • Rust 1.87+ with Cargo (for building the indexer and installer)
  • Optional: Qt6 6.6+ (with Qt6::DBus), KDE Frameworks 6.0+ (with KNotifications, KStatusNotifierItem), CMake 3.25+ (for the GUI)

Installation

Recommended: Full Build (CLI + GUI + Helper)

# Build everything (Rust CLI, D-Bus helper, FFI library, KDE GUI)
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

# Install all components (binaries, scripts, systemd units, D-Bus, polkit, icons, man page)
sudo cmake --install build

# Run the interactive setup wizard to configure backups
sudo btrdasd setup

The wizard configures backup sources, targets, retention, scheduling, email, and ESP mirroring — then generates all configuration files and enables timers.

CLI-Only (no GUI dependencies)

cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI=OFF
cmake --build build
sudo cmake --install build
sudo btrdasd setup

See docs/INSTALL.md for all installation methods including native distro packages, manual setup, and CMake build options.

Design Philosophy

  • Security-first: Rust for the data pipeline (no buffer overflows, use-after-free, or data races). C++20 RAII with -Werror for the GUI. Exclusive prepared statements for all SQL.
  • Memory safety: Minimal unsafe in Rust (libc calls and FFI boundary). No raw pointers in C++ GUI code. Smart pointers exclusively.
  • Efficiency: Span-based deduplication compresses file presence across snapshots. Incremental indexing skips already-processed snapshots. Six targeted performance indexes.
  • Stability: Indexing errors never abort backups (soft-fail). GUI gracefully handles missing or locked databases.
  • Privacy: File metadata only — no file contents are ever read or stored. No telemetry or network connections.

Documentation

License

MIT — See LICENSE for details.


(A note on versioning: Rust's Cargo.toml enforces strict 3-part semver — no x.y.z.w fourth segment allowed. This means non-functional changes like removing a dead Dockerfile or swapping an internal widget layout strategy each burn a full patch version. On 2026-03-07, this project went through v0.7.7, v0.7.8, AND v0.7.9 in a single evening — three patch releases that should have been one tweak bump from v0.7.7 to v0.7.7.3. >:| )

About

DAS backup manager with btrbk, content indexing (SQLite FTS5), and KDE Plasma GUI for browsing and restoring from BTRFS snapshots

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors