MyDumper
From fakedWiki
Restore
#!/bin/bash if [ -z $1 ]; then echo "Usage: $0 </path/to/mydumper/backup> [database-name]" exit 1 fi FINDNAME="*" if [ -n ${2} ]; then FINDNAME="${2}" fi for DBFILE in $(find ${1} -iname "${FINDNAME}_schema.sql.gz"); do DB=$(basename "${DBFILE}" | sed 's/_schema\.sql\.gz//') echo "Restoring schema for database '${DB}' from ${DBFILE}" zcat ${DBFILE} | mysql ${DB} for TFILE in $(find ${1} -iname "${DB}.*.sql.gz"); do TABLE=$(basename "${TFILE}" | sed -n "s/${DB}\.\(.*\)\.sql\.gz/\1/p") echo "Restoring table ${DB}.${TABLE}..." zcat ${TFILE} | mysql ${DB} done done