From: Emilie Zawadzki Date: Tue, 26 Nov 2019 16:14:55 +0000 (+0100) Subject: [Database] : update restore scripts X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=2ce8b401d4a9819f4cf83a8460253a6e0926c95b;p=docker-django-scripts.git [Database] : update restore scripts --- diff --git a/dev/local/restore_db.sh b/dev/local/restore_db.sh index 5392fd3..5530959 100755 --- a/dev/local/restore_db.sh +++ b/dev/local/restore_db.sh @@ -8,7 +8,7 @@ echo "Restoring..." # import database functions of type if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - gunzip < /srv/backup/mariadb.dump.gz | mysql -h db $MYSQL_DATABASE -uroot -p$MYSQL_ROOT_PASSWORD + gunzip < /srv/backup/mariadb.dump.gz | mysql -h localhost $MYSQL_DATABASE -uroot -p$MYSQL_ROOT_PASSWORD elif [ ! -z "$POSTGRES_PASSWORD" ]; then export PGPASSWORD=$POSTGRES_PASSWORD pg_restore -c -C -hdb -Upostgres -dpostgres /srv/backup/postgres.dump diff --git a/dev/restore_db_only.sh b/dev/restore_db_only.sh index 53b9bc4..ffdec67 100755 --- a/dev/restore_db_only.sh +++ b/dev/restore_db_only.sh @@ -1,3 +1,3 @@ #!/bin/sh -docker-compose run db /srv/bin/dev/local/restore_db.sh +docker-compose exec db /srv/bin/dev/local/restore_db.sh