diff --git a/infra/backup.sh b/infra/backup.sh index a15e4c9..feaa894 100755 --- a/infra/backup.sh +++ b/infra/backup.sh @@ -56,9 +56,11 @@ find_container() { log "--- SQLite ---" SERVER_CTR=$(find_container server) if [ -n "${SERVER_CTR}" ]; then - log "Dumping hiy.db via container ${SERVER_CTR}…" - podman exec "${SERVER_CTR}" sqlite3 "${HIY_DATA_DIR}/hiy.db" .dump \ - > "${STAGING}/hiy.sql" + log "Copying hiy.db from container ${SERVER_CTR}…" + podman cp "${SERVER_CTR}:${HIY_DATA_DIR}/hiy.db" "${STAGING}/hiy.db" + log "Dumping hiy.db…" + sqlite3 "${STAGING}/hiy.db" .dump > "${STAGING}/hiy.sql" + rm "${STAGING}/hiy.db" elif [ -f "${HIY_DATA_DIR}/hiy.db" ]; then log "Server container not running — dumping from host path…" sqlite3 "${HIY_DATA_DIR}/hiy.db" .dump > "${STAGING}/hiy.sql"