changed function order in backup script

This commit is contained in:
André Bauer 2017-11-11 11:35:43 +01:00
parent f0814f4bbf
commit c32a7b74ff

View File

@ -1,5 +1,13 @@
#!/bin/bash #!/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 { function zammad_backup {
TIMESTAMP="$(date +'%Y%m%d%H%M%S')" 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 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 if [ "$1" = 'zammad-backup' ]; then
check_railsserver_available check_railsserver_available