Clean up SQLite dump temp files on failure
This commit is contained in:
@@ -81,7 +81,11 @@ dump_sqlite_file() {
|
|||||||
tmp="$TMP_DIR/$(basename "$output").tmp"
|
tmp="$TMP_DIR/$(basename "$output").tmp"
|
||||||
log "Dumping SQLite database '$label' from $source"
|
log "Dumping SQLite database '$label' from $source"
|
||||||
rm -f "$tmp"
|
rm -f "$tmp"
|
||||||
sqlite3 "$source" ".backup $tmp"
|
if ! sqlite3 "$source" ".backup $tmp"; then
|
||||||
|
warn "SQLite backup failed for $label"
|
||||||
|
rm -f "$tmp"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
if [ "$(sqlite3 "$tmp" 'PRAGMA quick_check;')" != "ok" ]; then
|
if [ "$(sqlite3 "$tmp" 'PRAGMA quick_check;')" != "ok" ]; then
|
||||||
warn "SQLite quick_check failed for $label"
|
warn "SQLite quick_check failed for $label"
|
||||||
rm -f "$tmp"
|
rm -f "$tmp"
|
||||||
|
|||||||
Reference in New Issue
Block a user