SkillsCapabilitiesExploreContact
Projects
3D Printed Drones
Upgrading Shop Air Compressor
Aluminum Mountains
Bosswatt Prototype
Bronco Bumper
Machining a camera mount
Chuck Back Plates
Climbing Wall
CNC Surface Grinder Retrofit
5C Collet Box
Truck Crane Frame Fabrication
Leaf Spring Crossbow
Desktop Organizer
Engraving Tools
Festival Totem
Quick fix: Fixing household goods with a 3d printer
Fixture Table
Pirhana Plant
Building a Generator in Several Distinct Steps
Geodesic Treehouse
Grinding a custom groove cutting tool
Hanging Plotter
Hardtail Mini Bike
Welding an Infinity Cube
Lavender Sculpture
Small part: Mouse Axle
Mr Fixums' Lathe Handwheel Repair
Company Logo Sulpture
Penny Fakething Freak Bike
Picture Framing
DIY Press Brake
Building the Official Prusa Printer Enclosure out of Ikea Lack Tables
Scale License Plate
Metal Rose
Extending the Shop
Slip Roller
Full Suspension Mini Bike
Protoyping with python by creating an email task digest
Machining a Tube Bender
Turbofurnace
First Welding Project: Making a Weld Cart
Weld Cart (for everlast)
Welding Positioner
Layered Backup Workflow
Local LLM
Northwest Waxworks
Obsidian Remotion
Building My Portfolio Into a Publishing System
Staübli Reborn: Industrial Robot with a Modern Control System
thumbnail

Layered Backup Workflow

2023-1-15
Project
Skill
Software
Nixos
Python
Bash
Summary:
  • Built host-specific Borg backup automation with per-machine pattern files, session logging, and centralized archive management
  • Developed Python migration tooling to reconstruct Arq 5 backup commit history into Borg archives with incremental restores and verification reporting
  • Implemented marker-file-based stateful workflow to handle interrupted migrations and validate data integrity after restores
  • Designed offsite replication pipeline using ZFS snapshots synced to Backblaze B2, avoiding race conditions from copying live data

I built this repo to make backups less ad hoc. It started with a Borg script and host-specific pattern files, then grew into tooling for migrating old Arq backups into Borg, and later picked up an offsite replication step to Backblaze B2.

At the top level, backup.sh is the boring useful part. It looks up a pattern file for the current host, sorts restore-style R rules by modification time, writes logs under log/$HOSTNAME/$SESSION, and pushes an archive into the remote Borg repo on serverbox.zone. That is already enough to make the thing practical: one script, one place to run it, machine-specific file selection, and logs I can actually inspect later.

The more interesting bit is arq/. That directory is a pile of Python tools for pulling apart Arq 5 backups and rebuilding their history in Borg. The README is pretty explicit about the goal: not just restore the latest snapshot, but walk commit history over time and turn each Arq commit into a Borg archive. There are scripts for listing computers, folders, and commits, scripts for restoring files incrementally, and marker files to keep track of what step completed cleanly.

That marker-based flow is the part I like here. Backup migration gets weird fast once you hit interrupted runs, metadata mismatches, permissions nonsense, or missing blobs. restore.py, restore_files.py, check_restore.py, and generate_report.py all point at the same conclusion: getting data back is only half the job, the other half is being able to tell whether the result is good enough to trust.

Later on I added offsite.sh, which does the sensible thing instead of the exciting thing. It SSHes to the backup host, checks that Borg is not locked, takes a ZFS snapshot, and syncs that snapshot to Backblaze B2 with rclone. Copying a snapshot is a lot less spooky than copying a live tree that might still be changing.

There is also a sync/ directory describing a separate Syncthing-based workflow for live project folders. I kept that concern separate on purpose. Syncthing is for keeping active files around. Borg is for immutable history. Mixing those ideas too much is how you end up debugging something stanky at 1am.

What Was Built

Host-specific Borg backups — backup.sh plus patterns/THEODORE, patterns/ZULU.local, and patterns/ViFiveMBP define what each machine backs up and where the archive lands.

A reproducible dev shell — flake.nix gives me a lightweight environment with the tools needed to run and maintain the workflow.

Arq migration tooling — the arq/ scripts document the data format, decrypt and parse Arq metadata, restore trees incrementally, check results, and generate reports about what happened.

Offsite replication — offsite.sh snapshots the remote ZFS dataset and syncs it to Backblaze B2 so the backup server is not the only place the backup exists.

Skills Demonstrated

  • Bash scripting for automation and logging
  • Python for restore tooling, verification, and reporting
  • Stateful workflow design using marker files
  • Borg backup management
  • ZFS snapshot workflows
  • Remote automation over SSH
  • Nix-based environment setup
Previous Next
Featured Work
CNC Surface Grinder RetrofitWelding PositionerStaübli Reborn: Industrial Robot with a Modern Control System
Company Info
About UsContact UsPrivacy Policy
Specific Solutions LLC
Portland, OR