Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Reduce copycat-db restore scratch usage

Manav Rathica7dd59a9e32
diff --git a/infra/copycat-db/src/restore.sh b/infra/copycat-db/src/restore.sh
index 2c5910f47c..d7b38744fc 100755
--- a/infra/copycat-db/src/restore.sh
+++ b/infra/copycat-db/src/restore.sh
@@ -30,8 +30,10 @@ rclone copy --log-level INFO "${RCLONE_DESTINATION}${BACKUP_FILE}" .
# Unpack directory-format backups so pg_restore can read BACKUP_FILE directly.
if test "${BACKUP_FILE%.custom}" = "$BACKUP_FILE"; then
+ ARCHIVE_FILE=$BACKUP_FILE
zstd -dc "$BACKUP_FILE" | tar -xf -
BACKUP_FILE="${BACKUP_FILE%.tar.zst}"
+ rm "$ARCHIVE_FILE"
fi
# Restore from it