Use gzip compression for PostgreSQL dump (was 306MB, exceeds GitHub 100MB limit)

This commit is contained in:
2026-06-09 04:12:08 +00:00
parent 1d41970b8d
commit ab245ba5e0
3 changed files with 22 additions and 7 deletions
+5 -3
View File
@@ -41,9 +41,11 @@ mkdir -p database freeswitch/autoload_configs freeswitch/sip_profiles \
# devices, voicemail, users) lives here.
# ---------------------------------------------------------------------------
log "Dumping PostgreSQL fusionpbx database"
su -c "pg_dump --clean --if-exists fusionpbx" postgres > database/fusionpbx.sql 2>/dev/null
DUMP_SIZE=$(wc -c < database/fusionpbx.sql)
log " DB dump: $(numfmt --to=iec $DUMP_SIZE 2>/dev/null || echo ${DUMP_SIZE}B)"
su -c "pg_dump --clean --if-exists fusionpbx" postgres 2>/dev/null | gzip > database/fusionpbx.sql.gz
# Remove old uncompressed dump if it exists
rm -f database/fusionpbx.sql
DUMP_SIZE=$(wc -c < database/fusionpbx.sql.gz)
log " DB dump (compressed): $(numfmt --to=iec $DUMP_SIZE 2>/dev/null || echo ${DUMP_SIZE}B)"
# Also dump roles/users
su -c "pg_dumpall --globals-only" postgres > database/postgres_globals.sql 2>/dev/null