[2e23dc]: dist / bin / build-dump-pack-database-mysql.sh Maximize Restore History

Download this file

build-dump-pack-database-mysql.sh    50 lines (41 with data), 854 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# bbou@ac-toulouse.fr
# 25/11/2013
dbtag=$1
shift
if [ -z "${dbtag}" ]; then
echo "$0 <dbtag:30|31|31_snapshot>"
exit 1
fi
if [ -z "$MYSQLPASSWORD" ]; then
MYSQLPASSWORD=$1
shift
if [ -z "$MYSQLPASSWORD" ]; then
read -s -p "enter root's password: " MYSQLPASSWORD
echo
export MYSQLPASSWORD
fi
fi
# D A T A B A S E
db="wordnet${dbtag}"
dbms='mysql'
# D I R S
distdir="`dirname $(readlink -m $0)`/"
distdir="$(readlink -m ${distdir}/..)"
echo "distdir=${distdir}"
builderdir=${distdir}/../run
builderdir="$(readlink -m ${builderdir})"
echo "builderdir=${builderdir}"
# M A I N
# build
echo "build ${db}"
cd ${builderdir}/bin
./build-${dbms}.sh ${dbtag} $MYSQLPASSWORD
# dump
echo "dump ${db}"
cd ${distdir}
./dump-${dbms}.sh --schema ${dbtag} $MYSQLPASSWORD
# pack
echo "pack ${db}"
cd ${distdir}
./pack.sh ${dbms} ${dbtag}