🛟
skbackup · sovereign backup

skbackup

No backup is real until a restore is tested.

skbackup snapshots your data every hour, copies every app to a second disk every night, encrypts everything on your own machine before a single byte leaves it, ships it to a bucket you own, and then, once a month, pulls a piece back out of that bucket and checks it hash for hash against the original. If any of that stops happening, you hear about it within hours, not after the disk dies.

6tiers, each named by what it survives
On-hostencryption, before upload
1×/morestore from offsite, sha256-checked
1×/hrstaleness check that pages
1playbook, every tier from one vault block

What skbackup is

skbackup is the backup layer of the SKWorld stack. On servers it is an Ansible role in SKStacks (shipped since SKStacks v2.26.0) that turns the storage host behind a cluster into a self-checking backup machine. On laptops and other endpoints it is a set of documented patterns built on the same engine, restic, the same encryption and the same rule: you have not backed something up until you have restored it.

Your keys, your buckets

restic encrypts on your host before upload. The bucket holds ciphertext, the password lives in your vault, and no vendor ever holds your data in readable form.

Frozen, never live

Copies and uploads read a ZFS snapshot taken after the database dumps, so every app is captured at the same instant. No torn files from a copy that raced a write.

Proven monthly

A scheduled restore test reads back from the offsite copy and compares sha256 against the exact snapshot each file came from. Any mismatch, or nothing compared, is a failure.

Loud when it is quiet

An hourly check flags any tier that went stale, a pool filling up, a dump that stopped, a copy that suddenly shrank, or a host that stopped answering.

Gentle on production

Runs locally on the storage host at night, bandwidth capped and at idle I/O priority, with the cap chosen from measurement, not hope.

Yours to rebrand

Every name a customer sees comes from one brand block, and a test fails the build if a default brand string leaks through. Built for MSPs.

§Six tiers, named by what they survive

Most backup pages list features. This one lists failures, because that is what a backup is for. Each tier exists to survive something the tier before it cannot. Every one is switched on or off per instance.

TierWhat it doesSurvivesDoes not survive
1 · Snapshotssanoid snapshots the whole data dataset (36 hourly, 30 daily, 8 weekly, 6 monthly by default) plus a one-command pre-deploy snapshot.Deletes, bad deploys, fat fingers, ransomware on NFS clients (clients cannot destroy snapshots)Losing the data disk or the box
2 · Local copyPer-app copy from a frozen snapshot into a second pool on another disk, with its own daily, weekly and monthly history.A dead or corrupt data disk, a bad rollbackLosing the box
3 · DumpsDatabase dump hooks run before the freeze, and every app's dump directory is checked for freshness.Turns crash-consistent engine files into portable, testable dumps in every other tier 
4 · Offsiterestic, client-side encrypted and deduplicated, to S3, Backblaze B2, a REST server or any restic backend, upload-capped.Losing the box, the building, the siteLosing the repository password
5 · Restore testMonthly: one app restored whole plus random sample files, from the offsite copy, sha256 against their source snapshot.A backup that exists but cannot be restored 
6 · Checks + alertsHourly staleness and health checks, one keyed alert per finding, optional Healthchecks-style pings.Silent failure of any tier above 

That "does not survive" column is deliberate. A backup product that cannot tell you what it does not cover is asking you to find out the hard way.

§One night on the storage host

The defaults, all of them systemd timers you can move, and every step reading a frozen source rather than live files.

every hour sanoid snapshots the data dataset [tier 1] :17 check: staleness, dumps, pools, shrink [tier 6] 05:30 sync 1. dump hooks write fresh DB dumps INTO the dataset [tier 3] 2. dump freshness check (warns, never blocks) 3. one zfs snapshot freezes every app at one instant 4. rsync each app from that snapshot to the pool [tier 2] capped at 10000 KiB/s, idle I/O, 2 h per app 5. history snapshot per app, old ones pruned 06:30 restic mount the newest snapshot READ-ONLY, stable path [tier 4] restic backup per set, encrypted on this host --limit-upload 8000 KiB/s, long seeds resume next night Sun 13:00 restic forget --prune (7 daily, 4 weekly, 6 monthly) Sun 15:00 restic check on a data subset (when a subset is set) 1st 14:00 restore test from OFFSITE, sha256 vs source [tier 5]

Why a stable path

restic finds its parent snapshot by path. Backing up .zfs/snapshot/<name>, which changes nightly, makes it re-read everything. skbackup mounts the snapshot at the same path every night, so a nightly run reads only what changed.

Why a bandwidth cap

Measured on a single-SSD NFS pool: a copy capped at 40000 KiB/s pushed an NFS write from a cluster node to 45 seconds. At 10000 KiB/s the worst probe was 1.4 s with every service healthy. The default is the second number.

Why one hung app cannot sink the night

Each app copy has a time budget. A stuck app is killed and the run moves on, so it cannot starve every app after it. A big first seed simply resumes on the next run.

§Proof, not hope

"Succeeded" is not "restorable".

A green backup job tells you a program exited zero. It does not tell you the bytes in the bucket can become your files again. So skbackup asks the only question that matters, on a schedule, from the copy that matters most.

monthlyThe restore test

  • From the offsite copy. Not from the local pool, not from the live disk. From the encrypted bucket, the copy you would actually reach for after losing the box.
  • One whole app plus a random sample. A chosen app is restored in full; random files are drawn from a large set (large sets are sampled, not restored whole).
  • Hash for hash against the exact source. Each file's sha256 is compared with the same file in the ZFS snapshot it was backed up from. If that snapshot has expired, the live file is used only when size and modification time still match; otherwise the file counts as skipped, never as passed.
  • Fail closed. Any mismatch is a failure. Nothing compared is also a failure. The report is written to disk and sent as an alert, info on pass, critical on fail.

What gets watched every hour

CheckFlags when
Newest snapshotOlder than 120 minutes
Newest local copy, per appOlder than 26 hours
Last good offsite run, per setOlder than 36 hours (a brand-new set gets a 7-day seed grace and reports PENDING, not STALE)
Database dumpsA dump directory has nothing newer than 26 hours, or a dump hook failed
Copy shrinkA copy lost more than half its size overnight: a source that emptied, or a run that deleted before it wrote
Pools and thin poolsA pool past 80 percent or not ONLINE; an LVM thin pool or volume under the backup pool filling up
The host itselfRun from a separate alert host over ssh, an unreachable storage host pages too

Alerts go wherever you point them: a local log, any command (chat, mail, pager, webhook) with keyed de-duplication, and optional Healthchecks-style success and failure pings whose URL lives in its own root-only file and is never logged.

§Restore, by failure

Every tier comes with its restore path written down, because 3 a.m. is a bad time to work out the command.

You lostRestore fromHow
A file, an app, a bad deployTier 1 snapshotCopy out of .zfs/snapshot/, or clone the snapshot instantly for a big restore. Never roll back the shared dataset: that rolls back every app.
The data diskTier 2 copyrsync the app's dated history snapshot back, throttled, with the app stopped.
A databaseTier 3 dumpBring the dump directory back from any tier, then the database's own restore (pg_restore, mysql <).
The whole boxTier 4 offsiteOn any machine with restic and the credentials: restic snapshots, then restic restore by set and path.
ConfidenceTier 5 reportThe monthly rehearsal of tier 4. Read the report.

§Beyond the server: laptops and secrets

Servers are only half of what you cannot afford to lose. The same engine and the same rules extend to the machines people actually work on, and to the keys that unlock everything else.

born from a failureThe Windows laptop + WSL pattern Documented pattern

This one exists because a laptop drive died. Everything on it that was not somewhere else was gone. The pattern below is what we put in place so that it never costs anything again.

  • One bucket per device, one key per bucket. The laptop holds a key that can reach its own bucket and nothing else. Compromise one laptop and you have compromised one laptop.
  • Deleting is not erasing. A delete through the backup path only hides a file, and the bucket's lifecycle keeps hidden versions for 30 days. Malware that wipes the repository from the laptop leaves recoverable history behind.
  • Client-side encryption. restic encrypts on the laptop; the bucket provider stores ciphertext.
  • Consistent Windows captures. Windows profiles are read from a VSS snapshot, run as SYSTEM by Task Scheduler, with catch-up after sleep so a closed lid does not mean a skipped day.
  • The Linux side too. The WSL home is backed up as its own user.
  • Retention: 14 daily, 8 weekly, 12 monthly. Pruning runs only from a trusted server, never from the laptop.
  • Silence is an alert. No new snapshot in 36 hours raises a staleness alert.
  • Proven by a restore. A restore test with a hash compare is the evidence it works, not the backup log.

keys to the kingdomHost secrets offsite Documented pattern

Vault passwords, SSH and GPG keys, identity keys: the small files that, if lost, lock you out of every other backup you have. They go offsite with restic to their own bucket, encrypted on the host.

  • Tag-scoped retention. restic forget runs per tag, so pruning one kind of secret never touches another.
  • Verified byte for byte. The restore is checked with restic dump and sha256 against the source file.
  • The one secret you keep offline. The repository password itself has an offline copy. A restic repository without its password is noise, by design.

Honest status: these two are documented, supported patterns that you set up from the runbook today. The server tiers above are automated end to end by the Ansible role; the endpoint patterns are not yet an installer.

§Principles

🔑 Sovereignty

  • Encryption happens on your machine, with a password only you hold.
  • Any restic backend works: a public object store, your own S3-compatible store on another site, a REST server, a local path.
  • No agent phones home, no dashboard in someone else's cloud, no lock-in. Your backup is a restic repository any restic binary can read.

3️⃣ 3-2-1, for real

  • Three copies: the live data, the second pool, the offsite bucket.
  • Two media: separate disks and pools, never a "backups" folder on the same disk (that protects against nothing that loses the disk).
  • One off the site: only an off-box copy survives a host that holds both the storage and every VM.

🛡️ Least privilege, ransomware-aware

  • One bucket, one key scoped to it, never the account master key on a host.
  • NFS clients cannot destroy ZFS snapshots, so a compromised cluster node cannot erase tier 1.
  • Bucket lifecycle can keep deleted versions as an undo window (30 days on endpoints; on servers it is a cost trade-off you choose).
  • Pruning from a trusted host, not from the device being protected.

📜 Everything as code

  • One Ansible playbook, one vault block, merged over documented defaults.
  • restic from the distribution, or (recommended) a pinned upstream release the deploy refuses to install unless its sha256 matches.
  • The deploy fails closed on unsafe names, missing passwords, unknown set kinds and leftover keys from the retired engine.
  • The engine is tested against a real local restic repository: copy, restore byte-exact, parent reuse, restore-test pass and mismatch.

🧪 Restore is the product

  • Deploy step 5 of the runbook is "prove it before trusting it": copy one small app, compare counts, bytes and a sha256 sample, back it up twice and restore a file by hand.
  • Then the monthly restore test keeps proving it, unattended.

🧭 Back up what you cannot regenerate

  • Config, secrets, TLS state, database dumps, mail, git, anything a person made: copy and offsite.
  • Thumbnails, caches, CI artifacts, search indexes, logs: skipped and rebuilt. A lean backup is one you can afford to keep deep history of.
  • One standard across servers, hypervisor storage hosts and Windows and WSL endpoints: the SKWorld backup and retention standard.

§Lessons paid for in production

skbackup's defaults are not guesses. Each of these is in the engine because something went wrong first.

The cap is the safety

An unthrottled bulk copy once outran another service's health check and caused a long outage. Heavy I/O on a shared pool is a production change.

Same disk is not a backup

Copies into a folder on the NFS pool doubled the space used and protected against nothing that loses the disk. A snapshot gives the same safety instantly at zero I/O.

S3 means AWS_*

restic's S3 backend reads only the AWS_* credential names. B2 key names in an env file do nothing unless mapped, so skbackup maps them.

Dumps drift

A dump sidecar's schedule was measured drifting about 13 minutes a day until it crossed the backup slot. Pin dump schedules, keep the newest two, check freshness.

Snapshots pin deleted data

Decide what to do with legacy data before retention starts, or the space only comes back when the last monthly snapshot holding it expires.

Config before package

sanoid starts its timer on install. skbackup writes the snapshot policy first, so the timer never runs against a default it did not choose.

§What skbackup does not claim

§Ship it under your name

skbackup follows the SKStacks vanity-layer pattern. One block in the vault renames the command, the install paths, the systemd units, the alert subjects, the report footer and the restic tags. The engine carries no brand string of its own, and a test renders the whole deploy in white-label mode and fails if any default brand string appears anywhere a customer could see it.

skbackup: branding: product_name: Acme Vault short_name: acmevault tagline: Your data, kept safe by Acme IT alert_prefix: ACME-VAULT report_footer: Acme IT managed backup service contact: support@acme.example unit_prefix: acme- # the host now has /usr/local/sbin/acmevault, acme-acmevault-sync.timer, # alerts "[ACME-VAULT] crit: ..." and reports signed by Acme IT

§Get started

Put the storage host in an inventory group, create the second pool on a different disk, write the vault block, and run one playbook. The play never touches the cluster itself.

skbackup: data_dataset: tank/data copy: enabled: true target: backup/copies apps: [{name: app-one, dump: database-dump}] offsite: enabled: true repository: s3:https://s3.<region>.backblazeb2.com/<your-bucket> password: "{{ from your vault }}" sets: [{name: apps, kind: apps}] restore_test: {enabled: true, app: app-one} ansible-playbook -i <inventory> \ v1/ansible/optional/skbackup/deploy_skbackup-prod.yml \ --vault-password-file <file> -e skbackup_hosts=<storage group> skbackup status # what is configured, and when each tier last succeeded skbackup check # OK / STALE / WARN / PENDING, one line per check

§Architecture: three ways to read it

Each diagram is a standalone, self-contained HTML page: explorable, with motion and a dark/light toggle. They open in a new tab.

A plain Mermaid version of the component map, which renders directly on GitHub, lives in the repository README.

§Roadmap: skbackup-webui Planned, not shipped

Today every host knows its own backup health and pages when it slips. Next is seeing the whole fleet at once: a backup dashboard behind SSO that answers "is everything backed up?" in one glance.

server-a server-b laptop-1 secrets

Illustration only: a mock-up of the planned grid, not live data.

Hosts by days

A grid of green and red runs per host per day, with last run, duration, bytes added, snapshot counts and staleness at a glance.

Restore results first-class

Every restore test result on the same screen as the backups it proves.

Nothing worth stealing

Built from run records each host pushes. No repository passwords and no write keys ever live on the dashboard.

Phase 1: run pings

Self-hosted Healthchecks-style pings, building on the success and failure pings the engine can already send.

Part of the ecosystem

skbackup keeps what SKStacks runs recoverable, skpatch keeps it current, and skaegis and sksec keep it defended. Secrets live in SKVault. All part of SKWorld, the sovereign AI ecosystem where you own the whole stack, from silicon to soul.