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.
This commit is contained in:
parent
6efbb61afc
commit
288ccef090
1 changed files with 3 additions and 0 deletions
|
|
@ -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))"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue