Skip to content

Instantly share code, notes, and snippets.

@Dnile
Last active April 21, 2017 01:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Dnile/4658b338d4a101cbe2eeb5080ebddf8e to your computer and use it in GitHub Desktop.
Save Dnile/4658b338d4a101cbe2eeb5080ebddf8e to your computer and use it in GitHub Desktop.
my dumper load from backups
#!/usr/bin/env sh
cd $BACKUP_DIR
export DESTHOST=127.0.0.1
export BACKUP_DIR=/vol_mysql/backups
mysqld --skip-grant-tables &
for i in `ls -1 *-schema.dump.gz | cut -d'-' -f1`; do mysql -h $DESTHOST -e "CREATE DATABASE IF NOT EXISTS $i"; zcat $i-schema.dump.gz | mysql -h $DESTHOST $i; zcat $i-schema-post.dump.gz | mysql -h $DESTHOST $i; done
/usr/bin/myloader --host=$DESTHOST --directory=$BACKUP_DIR --enable-binlog --threads=10 --queries-per-transaction=20 -v 3
chown -R mysql:mysql /var/lib/mysql/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment