Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
my dumper load from backups
#!/usr/bin/env sh
export DESTHOST=
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
You can’t perform that action at this time.