Last active
April 21, 2017 01:55
-
-
Save Dnile/4658b338d4a101cbe2eeb5080ebddf8e to your computer and use it in GitHub Desktop.
my dumper load from backups
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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