File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
install/etc/s6/services/10-db-backup Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 1.13 - 2019-03-09 - <dave at tiredofit dot ca >
2+
3+ * Fixed Postgres backup without SPLIT_DB enabled (credit MelwinKfr@github)
4+ * Added DB_PORT reference to properly backup Postgres with non default ports (thanks Maxximus007@github)
5+
16## 1.12 - 2019-03-01 - <stevetodorov at github >
27
38* Fix for XZ Compression failing
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ function backup_mongo() {
146146function backup_pgsql() {
147147 if [ "$SPLIT_DB" = "TRUE" ] || [ "$SPLIT_DB" = "true" ]; then
148148 export PGPASSWORD=${DBPASS}
149- DATABASES=`psql -h $DBHOST -U $DBUSER -c 'COPY (SELECT datname FROM pg_database WHERE datistemplate = false) TO STDOUT;' `
149+ DATABASES=`psql -h $DBHOST -U $DBUSER -p ${DBPORT} - c 'COPY (SELECT datname FROM pg_database WHERE datistemplate = false) TO STDOUT;' `
150150 for db in $DATABASES; do
151151 echo "** [db-backup] Dumping database: $db"
152152 TARGET=pgsql_${db}_${DBHOST}_${now}.sql
@@ -157,7 +157,7 @@ function backup_pgsql() {
157157 done
158158 else
159159 export PGPASSWORD=${DBPASS}
160- pg_dump -h ${DBHOST} -U ${DBUSER} $db > ${TMPDIR}/${TARGET}
160+ pg_dump -h ${DBHOST} -U ${DBUSER} -p ${DBPORT} ${DBNAME} > ${TMPDIR}/${TARGET}
161161 generate_md5
162162 compression
163163 move_backup
You can’t perform that action at this time.
0 commit comments