infra/pi: install.sh keeps the deployed KVITT_TAG and checks python3; env_set cleans its temp file; backup.sh removes half-written archives on failure
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
@@ -16,8 +16,10 @@ BACKUP_DIR=${BACKUP_DIR:-/backups}
|
||||
DB="$DATA_DIR/kvitt.sqlite"
|
||||
STAGING="$BACKUP_DIR/staging"
|
||||
|
||||
db_out=""; pics_out=""
|
||||
log() { echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) backup: $*"; }
|
||||
fail() { log "FAILED: $*"; rm -f "$STAGING/kvitt.sqlite"; exit 1; }
|
||||
# Removes the snapshot and any half-written archive of this run; finished archives stay for the next upload.
|
||||
fail() { log "FAILED: $*"; rm -f "$STAGING/kvitt.sqlite" ${db_out:+"$db_out.tmp"} ${pics_out:+"$pics_out.tmp"}; exit 1; }
|
||||
|
||||
[ -f "$DB" ] || fail "no database at $DB"
|
||||
mkdir -p "$STAGING"
|
||||
|
||||
Reference in New Issue
Block a user