forked from the-fascinator/the-fascinator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tf_purge.sh
executable file
·68 lines (53 loc) · 1.53 KB
/
tf_purge.sh
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
#
# this script is used for deleting fascinator data
# data will be deleted:
# 1. $TF_HOME/storage
# 2. $TF_HOME/activemq-data
# 3. $TF_HOME/logs
# 4. $TF_HOME/cache
# 5. $SOLR_BASE_DIR/solr/indexes/anotar/index
# 6. $SOLR_BASE_DIR/solr/indexes/fascinator/index
# 7. $SOLR_BASE_DIR/solr/indexes/security/index
# suppress console output from pushd/popd
pushd() {
builtin pushd "$@" > /dev/null
}
popd() {
builtin popd "$@" > /dev/null
}
# get fascinator home dir
pushd `dirname $0`
TF_CODE=`pwd`
popd
if [ "$1" == "" ]; then
echo "Usage: ./`basename $0` all|solr"
exit 0
fi
# setup environment
. $TF_CODE/tf_env.sh
if [ "$1" == "all" ]; then
echo Deleting all data
echo Deleting: $TF_HOME/storage
rm -rf $TF_HOME/storage
echo Deleting: $TF_HOME/activemq-data
rm -rf $TF_HOME/activemq-data
echo Deleting: $TF_HOME/logs
rm -rf $TF_HOME/logs
echo Deleting: $TF_HOME/database/fsHarvestCache
rm -rf $TF_HOME/database/fsHarvestCache
echo Deleting: $TF_HOME/cache
rm -rf $TF_HOME/cache
fi
if [ "$1" == "all" -o "$1" == "solr" ]; then
echo Deleting solr data
if [ ! -d "$SOLR_BASE_DIR/solr" ]; then
SOLR_BASE_DIR = $TF_HOME
fi
echo Deleting: $SOLR_BASE_DIR/solr/indexes/anotar/index
rm -rf $SOLR_BASE_DIR/solr/indexes/anotar/index
echo Deleting: $SOLR_BASE_DIR/solr/indexes/fascinator/index
rm -rf $SOLR_BASE_DIR/solr/indexes/fascinator/index
echo Deleting: $SOLR_BASE_DIR/solr/indexes/security/index
rm -rf $SOLR_BASE_DIR/solr/indexes/security/index
fi