Adds kernelwatch backup PATH, which writes a consistent copy of the SQLite
database. The database holds host token hashes, dashboard logins and report
history, and until now the README had no backup guidance. Copying the file
while the server runs can miss writes still in the -wal sidecar.
Uses SQLite's online backup API, so it's safe while hosts are reporting.
Builds the copy at a 0600 temp file beside PATH, then renames it into place,
so a failure never leaves a partial backup. An existing file at PATH is
replaced.
Refuses to write over the live database.
Exits 1 with backup failed: ... on errors such as a missing directory.
The command runs as the kernelwatch user via the wrapper, so PATH must be
writable by that user. The README documents a backups directory, restore steps,
and copying the result off-box.
No schema change, no config change, no agent change.
Testing
make test: 108 tests pass (4 new). They cover data and token lookup in the
copy including WAL-resident writes, integrity_check, 0600 mode, replacing an
existing file, refusing the live DB, and no leftover temp files after a failure.
## Summary
Adds `kernelwatch backup PATH`, which writes a consistent copy of the SQLite
database. The database holds host token hashes, dashboard logins and report
history, and until now the README had no backup guidance. Copying the file
while the server runs can miss writes still in the -wal sidecar.
- Uses SQLite's online backup API, so it's safe while hosts are reporting.
- Builds the copy at a 0600 temp file beside PATH, then renames it into place,
so a failure never leaves a partial backup. An existing file at PATH is
replaced.
- Refuses to write over the live database.
- Exits 1 with `backup failed: ...` on errors such as a missing directory.
The command runs as the `kernelwatch` user via the wrapper, so PATH must be
writable by that user. The README documents a backups directory, restore steps,
and copying the result off-box.
No schema change, no config change, no agent change.
## Testing
`make test`: 108 tests pass (4 new). They cover data and token lookup in the
copy including WAL-resident writes, integrity_check, 0600 mode, replacing an
existing file, refusing the live DB, and no leftover temp files after a failure.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
patrick
added 2 commits 2026-10-30 00:41:45 +00:00
Uses SQLite's online backup API, so it is consistent while the server is
writing in WAL mode. Writes mode 0600 via a temp file and rename, and
refuses to overwrite the live database.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Adds
kernelwatch backup PATH, which writes a consistent copy of the SQLitedatabase. The database holds host token hashes, dashboard logins and report
history, and until now the README had no backup guidance. Copying the file
while the server runs can miss writes still in the -wal sidecar.
so a failure never leaves a partial backup. An existing file at PATH is
replaced.
backup failed: ...on errors such as a missing directory.The command runs as the
kernelwatchuser via the wrapper, so PATH must bewritable by that user. The README documents a backups directory, restore steps,
and copying the result off-box.
No schema change, no config change, no agent change.
Testing
make test: 108 tests pass (4 new). They cover data and token lookup in thecopy including WAL-resident writes, integrity_check, 0600 mode, replacing an
existing file, refusing the live DB, and no leftover temp files after a failure.
🤖 Generated with Claude Code