Commit 72841420 authored by Michał 'rysiek' Woźniak's avatar Michał 'rysiek' Woźniak
Browse files

using pure text instead of a custom format for pg_dump due to potential memory...

using pure text instead of a custom format for pg_dump due to potential memory constraints/problems; also gzipping the dumps (both mysql and pgsql)
parent ce2cf896
......@@ -224,7 +224,7 @@ function dump_mysql_dbs {
# files
SCHEMA_FILE="$4/schemas/$db.schema.sql"
DUMP_FILE="$4/dumps/$db.dump.sql"
DUMP_FILE="$4/dumps/$db.dump.sql.gz"
echo " +-- schema file : $SCHEMA_FILE"
echo " +-- dump file : $DUMP_FILE"
......@@ -251,7 +251,7 @@ function dump_mysql_dbs {
# dump
echo " +-- dump..."
mysqldump -h "$1" -u "$2" --password="$3" --no-create-info --no-create-db --databases "$db" >> "$DUMP_FILE"
mysqldump -h "$1" -u "$2" --password="$3" --no-create-info --no-create-db --databases "$db" | gzip -c > "$DUMP_FILE"
[ $? -eq 0 ] || display_error_and_quit
echo " +-- done."
......@@ -431,7 +431,7 @@ function dump_postgres_dbs {
# files
SCHEMA_FILE="$4/schemas/$db.schema.sql"
DUMP_FILE="$4/dumps/$db.dump.sql"
DUMP_FILE="$4/dumps/$db.dump.sql.gz"
echo " +-- schema file : $SCHEMA_FILE"
echo " +-- dump file : $DUMP_FILE"
......@@ -452,7 +452,7 @@ function dump_postgres_dbs {
# dump
echo " +-- dump..."
PGPASSWORD="$3" pg_dump -h "$1" --create --data-only --format custom -U "$2" "$db" >> "$DUMP_FILE"
PGPASSWORD="$3" pg_dump -h "$1" --data-only --format plain --compress 9 -U "$2" "$db" > "$DUMP_FILE"
[ $? -eq 0 ] || display_error_and_quit
echo " +-- done."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment