~dveeden/mysql-sandbox/mysql-sandbox

« back to all changes in this revision

Viewing changes to script_templates/samples/clear

  • Committer: Giuseppe Maxia
  • Date: 2009-05-09 08:04:44 UTC
  • Revision ID: g.maxia@gmail.com-20090509080444-jy8a330el0mt425a
Tags: 3.0
- 3.0.00 GA release
- no code modification. Same codebase as 2.0.99f
- completed cookbook (41 recipes in MySQL::Sandbox::Recipes)
- added script_templates directory (No modification in current version, just preparation for 3.1.xx)
- added drafts directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/Users/gmax/usr/local/bin/bash
 
2
 
 
3
#-----------------------------------------
 
4
SBDIR="/Users/gmax/sandboxes/msb_5_1_34"
 
5
. "$SBDIR/sandbox_env"
 
6
#-----------------------------------------
 
7
 
 
8
#
 
9
# attempt to drop databases gracefully
 
10
#
 
11
if [ -f $PIDFILE ]
 
12
then
 
13
    for D in `echo "show databases " | ./use -B -N | grep -v "^mysql$" | grep -v "^information_schema$"` 
 
14
    do
 
15
        echo 'drop database `'$D'`' | ./use 
 
16
    done
 
17
    VERSION=`./use -N -B  -e 'select version()'`
 
18
    if [ `perl -le 'print $ARGV[0] ge "5.1" ? "1" : "0" ' "$VERSION"` = "1" ]
 
19
    then
 
20
        ./use -e "truncate mysql.general_log"
 
21
        ./use -e "truncate mysql.slow_log"
 
22
    fi
 
23
fi
 
24
 
 
25
./stop
 
26
#./send_kill
 
27
rm -f data/`hostname`*
 
28
rm -f data/log.0*
 
29
rm -f data/*.log
 
30
rm -f data/falcon*
 
31
rm -f data/mysql-bin*
 
32
rm -f data/*relay-bin*
 
33
rm -f data/ib*
 
34
rm -f data/*.info
 
35
rm -f data/*.err
 
36
rm -f data/*.err-old
 
37
# rm -rf data/test/*
 
38
 
 
39
#
 
40
# remove all databases if any
 
41
#
 
42
for D in `ls -d data/*/ | grep -w -v mysql ` 
 
43
do
 
44
    rm -rf $D
 
45
done
 
46
mkdir data/test
 
47