mirror of
https://github.com/myronblair/fusionpbx-config
synced 2026-06-30 17:50:16 -05:00
Use gzip compression for PostgreSQL dump (was 306MB, exceeds GitHub 100MB limit)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user