[metactl.post-start] restore without specifying database [metactl.pre-stop] backup with --flush-privileges
This commit is contained in:
parent
8b3466249c
commit
728f4f3e71
|
@ -46,7 +46,7 @@ if [ "$DUMP_FILE_EXISTS" = "0" ]; then
|
||||||
|
|
||||||
# Restore mariadb database
|
# Restore mariadb database
|
||||||
echo -ne " * Restore database..........";
|
echo -ne " * Restore database..........";
|
||||||
cat $MARIADB_DUMP | docker exec -i $MARIADB_SERVICE mysql -uroot -p$MARIADB_ROOT_PASSWORD $MARIADB_DATABASE_NAME 2>/dev/null && echo "restored" || echo "failed";
|
cat $MARIADB_DUMP | docker exec -i $MARIADB_SERVICE mysql -uroot -p$MARIADB_ROOT_PASSWORD 2>/dev/null && echo "restored" || echo "failed";
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
|
@ -15,5 +15,5 @@ test ! -d $ROOT/persistent && mkdir -p $ROOT/persistent;
|
||||||
|
|
||||||
# 2. Backup database
|
# 2. Backup database
|
||||||
echo -ne " * Backup database...........";
|
echo -ne " * Backup database...........";
|
||||||
docker exec $MARIADB_SERVICE mysqldump --all-databases -uroot -p$MARIADB_ROOT_PASSWORD > $MARIADB_DUMP;
|
docker exec $MARIADB_SERVICE mysqldump --all-databases --flush-privileges -uroot -p$MARIADB_ROOT_PASSWORD > $MARIADB_DUMP;
|
||||||
test "$?" = "0" && echo "done" || (echo "failed"; exit 1);
|
test "$?" = "0" && echo "done" || (echo "failed"; exit 1);
|
Loading…
Reference in New Issue