kernelwatch backup exists but nothing runs it. This adds a nightly timer.
kernelwatch scheduled-backup writes kernelwatch-YYYY-MM-DD.db (UTC date,
mode 0600, directory 0700) into backup_dir, replacing that day's file, then
deletes dated backups backup_keep_days (default 7) or more days old; 0 keeps
them all. It deletes only files with exactly that name, and only after the new
backup succeeded.
kernelwatch-backup.timer runs it at ~03:30 (random delay up to 30 min, Persistent=true) as the unprivileged kernelwatch user with the alerts
unit's sandbox plus PrivateNetwork=yes. server/install.sh enables it.
New server.toml settings backup_dir and backup_keep_days, validated.
README: nightly backups section; notes that the copies live on the dashboard
host and should be copied elsewhere, and that backup_dir must stay under /var/lib/kernelwatch unless the unit gets more write access.
Stacked on #16 (installer tests); merge that first.
Testing
make test: 177 tests pass (11 new): dated private copy and directory creation,
same-day replacement, pruning boundary, only dated files deleted, keep=0, a
failed backup prunes nothing, the live DB is never pruned, CLI success/failure,
config validation, the timer is enabled by the installer, and every command a
unit runs exists in the CLI. I broke the code on purpose (off-by-one, prune
everything, delete non-matching files, no backup) and each was caught.
## Summary
`kernelwatch backup` exists but nothing runs it. This adds a nightly timer.
- `kernelwatch scheduled-backup` writes `kernelwatch-YYYY-MM-DD.db` (UTC date,
mode 0600, directory 0700) into `backup_dir`, replacing that day's file, then
deletes dated backups `backup_keep_days` (default 7) or more days old; 0 keeps
them all. It deletes only files with exactly that name, and only after the new
backup succeeded.
- `kernelwatch-backup.timer` runs it at ~03:30 (random delay up to 30 min,
`Persistent=true`) as the unprivileged `kernelwatch` user with the alerts
unit's sandbox plus `PrivateNetwork=yes`. `server/install.sh` enables it.
- New `server.toml` settings `backup_dir` and `backup_keep_days`, validated.
- README: nightly backups section; notes that the copies live on the dashboard
host and should be copied elsewhere, and that `backup_dir` must stay under
`/var/lib/kernelwatch` unless the unit gets more write access.
Stacked on #16 (installer tests); merge that first.
## Testing
`make test`: 177 tests pass (11 new): dated private copy and directory creation,
same-day replacement, pruning boundary, only dated files deleted, keep=0, a
failed backup prunes nothing, the live DB is never pruned, CLI success/failure,
config validation, the timer is enabled by the installer, and every command a
unit runs exists in the CLI. I broke the code on purpose (off-by-one, prune
everything, delete non-matching files, no backup) and each was caught.
Not run: the timer on a real host.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
kernelwatch scheduled-backup writes kernelwatch-YYYY-MM-DD.db into backup_dir
and prunes dated copies backup_keep_days or older, only after the new backup
succeeded and only files with exactly that name. kernelwatch-backup.timer runs
it at about 03:30 as the unprivileged service user with no network, and
server/install.sh enables it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
patrick
merged commit 6652a4d795 into main2026-10-30 15:06:02 +00:00
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
kernelwatch backupexists but nothing runs it. This adds a nightly timer.kernelwatch scheduled-backupwriteskernelwatch-YYYY-MM-DD.db(UTC date,mode 0600, directory 0700) into
backup_dir, replacing that day's file, thendeletes dated backups
backup_keep_days(default 7) or more days old; 0 keepsthem all. It deletes only files with exactly that name, and only after the new
backup succeeded.
kernelwatch-backup.timerruns it at ~03:30 (random delay up to 30 min,Persistent=true) as the unprivilegedkernelwatchuser with the alertsunit's sandbox plus
PrivateNetwork=yes.server/install.shenables it.server.tomlsettingsbackup_dirandbackup_keep_days, validated.host and should be copied elsewhere, and that
backup_dirmust stay under/var/lib/kernelwatchunless the unit gets more write access.Stacked on #16 (installer tests); merge that first.
Testing
make test: 177 tests pass (11 new): dated private copy and directory creation,same-day replacement, pruning boundary, only dated files deleted, keep=0, a
failed backup prunes nothing, the live DB is never pruned, CLI success/failure,
config validation, the timer is enabled by the installer, and every command a
unit runs exists in the CLI. I broke the code on purpose (off-by-one, prune
everything, delete non-matching files, no backup) and each was caught.
Not run: the timer on a real host.
🤖 Generated with Claude Code