Exporting a config snapshot so rebuilds don't depend on memory
What happened
Backing up data is only part of recovery. Configuration matters too, and rebuilding after a lost host or a bad edit shouldn't depend on memory.
The fix / What I built
I added a command that exports configuration as JSON and text. It leaves out tokens and secrets files. Each export is written with a date into the existing backup location. The command keeps a limited number of past snapshots.
I made two additions to the daily digest:
- It fails if the newest snapshot is missing or too old.
- It shows a diff against the previous snapshot, so an unexpected change shows up.
The command is read-only. It reuses existing helpers, and it follows the same status pattern as the existing backup checks.
I ran it by hand and it produced a dated snapshot, and the freshness check passed.
Why it works
Config is small and cheap to export, and a dated copy gives you something to rebuild from. The diff also gives you evidence of drift, beyond other checks.
Takeaway
Review what a config export covers, and check that it stays fresh. A snapshot you can't trust to be current or complete won't help during a rebuild.