2018-02-18 14:28:52 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source $(dirname `realpath $0`)/environment.sh;
|
|
|
|
|
|
|
|
#############################################
|
|
|
|
## ##
|
|
|
|
## Executed before stopping containers ##
|
|
|
|
## ##
|
|
|
|
#############################################
|
|
|
|
|
2018-02-18 18:07:44 +00:00
|
|
|
## [1] Backup mariadb database
|
|
|
|
|
|
|
|
# 1. Create parent dir (if does not exists)
|
|
|
|
test ! -d $ROOT/persistent && mkdir -p $ROOT/persistent;
|
|
|
|
|
|
|
|
# 2. Backup database
|
|
|
|
echo -ne " * Backup database...........";
|
2018-03-20 23:11:11 +00:00
|
|
|
docker exec $MARIADB_SERVICE mysqldump --all-databases --flush-privileges -uroot -p$MARIADB_ROOT_PASSWORD > $MARIADB_DUMP;
|
2018-02-18 18:07:44 +00:00
|
|
|
test "$?" = "0" && echo "done" || (echo "failed"; exit 1);
|