3
# (c) 2012, Ovais Tariq <ovaistariq@gmail.com>
5
# This program is free software: you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation, either version 3 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program. If not, see <http://www.gnu.org/licenses/>.
23
# Create the database if it does not exists
24
mysql --user=$mysql_user --password=$mysql_pass -e "CREATE DATABASE IF NOT EXISTS \`${db}\`"
26
for dump_filename in $(grep "completed successfully" ${dump_dir}/${db}-dump.log | awk '{print $5}' | sed "s/${db}./${db}\//")
28
dump_filename=${dump_dir}/${dump_filename}.dump
32
echo "--- Reloading table $dump_filename"
33
mysql --user=$mysql_user --password=$mysql_pass $db < $dump_filename
37
echo "--- Failed to reload table $dump_filename"
39
echo "--- Reload of table $dump_filename completed successfully"
41
} >> ${dump_dir}/${db}-reload.log