From a29eb5bd89dda2ff036fabd7aedf94894a545ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Mon, 7 May 2018 18:28:17 +0200 Subject: [PATCH] added postgres vars to backup --- containers/zammad-postgresql/backup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/containers/zammad-postgresql/backup.sh b/containers/zammad-postgresql/backup.sh index f27f8e3..c93dda1 100644 --- a/containers/zammad-postgresql/backup.sh +++ b/containers/zammad-postgresql/backup.sh @@ -4,6 +4,10 @@ set -e : "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}" : "${ZAMMAD_RAILSSERVER_PORT:=3000}" +: "${POSTGRES_USER:=postgres}" +: "${POSTGRES_HOST:=zammad-postgresql}" +: "${POSTGRES_PORT:=5432}" +: "${POSTGRES_DB:=zammad_production}" function check_railsserver_available { until (echo > /dev/tcp/${ZAMMAD_RAILSSERVER_HOST}/${ZAMMAD_RAILSSERVER_PORT}) &> /dev/null; do @@ -28,7 +32,7 @@ function zammad_backup { fi #db backup - pg_dump --dbname=postgresql://postgres@zammad-postgresql:5432/zammad_production | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz + pg_dump --dbname=postgresql://${POSTGRES_USER}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz } if [ "$1" = 'zammad-backup' ]; then