Initial commit

This commit is contained in:
2020-04-29 01:29:07 +03:00
commit 3a1f5905d2
7 changed files with 74 additions and 0 deletions

11
dump.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
export DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CONFIG_FILE=$DIR/_config.sh
[[ ! -r "${CONFIG_FILE}" ]] && { echo "Could not read ${CONFIG_FILE}!"; exit 1; }
set -a
. "${CONFIG_FILE}"
set +a
# Синхронизация баз (удаление, если базы есть, и создание)
echo "Dump remote databases and pipi to local mariadb" >> $log_file
mysqldump --defaults-extra-file=./.remote.my.cnf --add-drop-database --databases "${databases[@]}" | mysql --defaults-extra-file=./.my.cnf