From c32a7b74ff0435f4c3ab1bdb9d14b560c1f4574a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sat, 11 Nov 2017 11:35:43 +0100 Subject: [PATCH] changed function order in backup script --- containers/zammad-postgresql/backup.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/containers/zammad-postgresql/backup.sh b/containers/zammad-postgresql/backup.sh index 94eb57c..86852e3 100644 --- a/containers/zammad-postgresql/backup.sh +++ b/containers/zammad-postgresql/backup.sh @@ -1,5 +1,13 @@ #!/bin/bash +function check_railsserver_available { + # wait for zammad process coming up + until (echo > /dev/tcp/zammad-railsserver/3000) &> /dev/null; do + echo "backup waiting for zammads railsserver to be ready..." + sleep 2 + done +} + function zammad_backup { TIMESTAMP="$(date +'%Y%m%d%H%M%S')" @@ -15,14 +23,6 @@ function zammad_backup { pg_dump --dbname=postgresql://postgres@zammad-postgresql:5432/zammad_production | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz } -function check_railsserver_available { - # wait for zammad process coming up - until (echo > /dev/tcp/zammad-railsserver/3000) &> /dev/null; do - echo "backup waiting for zammads railsserver to be ready..." - sleep 2 - done -} - if [ "$1" = 'zammad-backup' ]; then check_railsserver_available