From 288ccef090c760ec604e6843cd35e9dce8729173 Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 13 Oct 2026 09:05:17 +0530 Subject: [PATCH] Backup script removes same-day snapshot before VACUUM INTO VACUUM INTO refuses to overwrite, so re-runs silently kept stale data (backup showed 6 users, live had 2). Caught by comparing counts. --- deploy/termux-backup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/termux-backup.sh b/deploy/termux-backup.sh index dfb4b8f..488186e 100755 --- a/deploy/termux-backup.sh +++ b/deploy/termux-backup.sh @@ -6,6 +6,9 @@ cd "$(dirname "$0")/.." OUT="./backups/whaleprep-$(date +%F).db" mkdir -p ./backups +# VACUUM INTO refuses to overwrite, so remove today's snapshot first — +# otherwise re-runs silently keep stale data. +rm -f "$OUT" sqlite3 ./whaleprep.db "VACUUM INTO '$OUT';" ls -t ./backups/whaleprep-*.db | tail -n +8 | xargs -r rm -f echo "backup -> $OUT ($(du -h "$OUT" | cut -f1))"