Commit graph

2 commits

Author SHA1 Message Date
Roland
327071e878
check_database_integrity.sh: address greptile review
- Preserve MEDIA_DIRECTORY/WROLPI_DB across the sudo re-exec (sudo
  strips them from the environment, discarding the override).
- Reject unknown options and a second positional path with a usage
  error instead of silently checking the wrong database.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 19:47:48 -06:00
Roland
420e4957c9 help.sh: move DB integrity scan out of startup diagnostics
PRAGMA quick_check reads every page of the database, so on a large DB or
a slow (e.g. USB spinning) disk it can run for many minutes, making
help.sh (run by the wrolpi-help-script service) appear to hang.

Drop the quick_check from help.sh's fast startup diagnostics and add a
standalone scripts/check_database_integrity.sh for on-demand checks.
The new script runs sqlite3 as the wrolpi user (WAL -shm access),
reports elapsed time, and supports --full for an exhaustive
integrity_check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 19:47:35 -06:00