[5910a4]: dist / bin / all-x.sh Maximize Restore History

Download this file

all-x.sh    54 lines (44 with data), 1.0 kB

 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
50
51
52
#!/bin/bash
# bbou@ac-toulouse.fr
# 25/11/2013
# dbtag [password]
dbms='mysql'
dbtag=$1
shift
if [ -z "${dbtag}" ]; then
echo "$0 <dbtag:30|31|31_snapshot>"
exit 1
fi
if [ -z "$PASSWORD" ]; then
PASSWORD=$1
shift
if [ -z "$PASSWORD" ]; then
read -s -p "enter root's password: " PASSWORD
echo
export PASSWORD
fi
fi
# 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
echo "##### BUILD ${dbtag}#####"
pushd ${builderdir}/bin > /dev/null
./build-${dbtag}.sh ${dbtag} $PASSWORD
popd > /dev/null
echo "##### DUMP ${dbtag}#####"
pushd ${thisdir}/bin > /dev/null
./dump-${dbtag}.sh --schema ${dbtag} $PASSWORD
popd > /dev/null
echo "##### PACK ${dbtag}#####"
pushd ${thisdir}/bin > /dev/null
./pack.sh ${dbms} ${dbtag}
popd > /dev/null
echo "##### SQLITE ${dbtag}#####"
pushd ${thisdir}/bin > /dev/null
./make-sqlite-all.sh $PASSWORD
popd > /dev/null