From: Emilie Date: Mon, 11 Sep 2017 16:11:56 +0000 (+0200) Subject: [db] backup and restore X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bcfffdf67d2d11d46112795b12b5ede28cd2136e;p=docker-django-scripts.git [db] backup and restore --- diff --git a/backup_db.sh b/backup_db.sh new file mode 100755 index 0000000..349c1a4 --- /dev/null +++ b/backup_db.sh @@ -0,0 +1,3 @@ + #!/bin/sh + + docker-compose run db /srv/bin/db/backup.sh diff --git a/db/restore.sh b/db/restore.sh index b3569de..94ba8c3 100755 --- a/db/restore.sh +++ b/db/restore.sh @@ -6,8 +6,8 @@ export MYSQL="$(dpkg --get-selections | grep mysql 2>&1)" if [ ! -z "$MYSQL" ]; then - export MYSQL_PWD=$MYSQL_PASSWORD - mysql -h db $MYSQL_DATABASE -u$MYSQL_USER < /srv/backup/mariadb.dump + export MYSQL_PWD=$MYSQL_ROOT_PASSWORD + mysql -h db $MYSQL_DATABASE -uroot < /srv/backup/mariadb.dump elif [ ! -z "$POSTGRES" ]; then export PGUSER="postgres" diff --git a/restore_db.sh b/restore_db.sh new file mode 100755 index 0000000..8b9e895 --- /dev/null +++ b/restore_db.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker-compose run db /srv/bin/db/restore.sh