mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 21:53:42 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9051ba559a | ||
|
|
bf672c0fda | ||
|
|
9993ad2970 | ||
|
|
dc17d60b7b |
@@ -1,3 +1,12 @@
|
||||
## 1.13 - 2019-03-09 - <dave at tiredofit dot ca>
|
||||
|
||||
* Fixed Postgres backup without SPLIT_DB enabled (credit MelwinKfr@github)
|
||||
* Added DB_PORT reference to properly backup Postgres with non default ports (thanks Maxximus007@github)
|
||||
|
||||
## 1.12 - 2019-03-01 - <stevetodorov at github>
|
||||
|
||||
* Fix for XZ Compression failing
|
||||
|
||||
## 1.11 - 2018-11-19 - <skylord123 at github>
|
||||
|
||||
* Fix for Urnary Operator Error
|
||||
|
||||
@@ -50,7 +50,7 @@ if [ "$PARALLEL_COMPRESSION" = "TRUE " ]; then
|
||||
else
|
||||
BZIP="bzip2"
|
||||
GZIP="gzip"
|
||||
XZIP=="xz"
|
||||
XZIP="xz"
|
||||
fi
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ function backup_mongo() {
|
||||
function backup_pgsql() {
|
||||
if [ "$SPLIT_DB" = "TRUE" ] || [ "$SPLIT_DB" = "true" ]; then
|
||||
export PGPASSWORD=${DBPASS}
|
||||
DATABASES=`psql -h $DBHOST -U $DBUSER -c 'COPY (SELECT datname FROM pg_database WHERE datistemplate = false) TO STDOUT;' `
|
||||
DATABASES=`psql -h $DBHOST -U $DBUSER -p ${DBPORT} -c 'COPY (SELECT datname FROM pg_database WHERE datistemplate = false) TO STDOUT;' `
|
||||
for db in $DATABASES; do
|
||||
echo "** [db-backup] Dumping database: $db"
|
||||
TARGET=pgsql_${db}_${DBHOST}_${now}.sql
|
||||
@@ -157,7 +157,7 @@ function backup_pgsql() {
|
||||
done
|
||||
else
|
||||
export PGPASSWORD=${DBPASS}
|
||||
pg_dump -h ${DBHOST} -U ${DBUSER} $db > ${TMPDIR}/${TARGET}
|
||||
pg_dump -h ${DBHOST} -U ${DBUSER} -p ${DBPORT} ${DBNAME} > ${TMPDIR}/${TARGET}
|
||||
generate_md5
|
||||
compression
|
||||
move_backup
|
||||
|
||||
Reference in New Issue
Block a user