Phase 6 part 1: database backups

Backups with SQLite's VACUUM INTO into <data>/backups: on request
(Settings → Backups, supermarket backup [note]), before every schema
migration, and daily, keeping 7 dailies and 4 weeklies. Listed with size
and schema; downloadable and deletable. The old app.db.pre-* copies are
moved in, with their -wal files folded in first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 14:38:23 -07:00
co-authored by Claude Opus 5.5
parent c425f49c93
commit 5313369328
14 changed files with 1039 additions and 4 deletions
+9
View File
@@ -19,6 +19,8 @@ Usage: supermarket [command]
hermes Set up, or repair, Hermes' connection to your Core's MCP hub
token Print the token agents use to reach Supermarket's MCP endpoint
data Print where its data is kept
backup [note] Back up the database now (it also backs up daily)
backups List the backups
Updates come with CoreDesktop's \`update\`.
EOF
@@ -57,6 +59,13 @@ case "${1:-open}" in
logs) compose logs -f --tail 200 ;;
hermes) shift; bash "$REPO/hermes/setup.sh" "$@" ;;
token) cat "$DATA/mcp-token" ;;
backup|backups)
if ! docker exec supermarket true 2> /dev/null; then
echo "Supermarket isn't running: start it first (supermarket start)."
exit 1
fi
docker exec supermarket supermarket "$@"
;;
data) echo "$DATA" ;;
-h|--help|help) usage ;;
*) usage; exit 1 ;;