You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
529 B

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