forked from the-fascinator/the-fascinator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tf_purge.bat
76 lines (60 loc) · 1.9 KB
/
tf_purge.bat
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
68
69
70
71
72
73
74
75
76
@echo off
setlocal
REM this script is used for deleting fascinator data
REM data will be deleted:
REM 1. %FASCINATOR_HOME%/storage
REM 2. %FASCINATOR_HOME%/activemq-data
REM 3. %FASCINATOR_HOME%/logs
REM 4. %FASCINATOR_HOME%/cache
REM 5. %SOLR_BASE_DIR%/solr/indexes/anotar/index
REM 6. %SOLR_BASE_DIR%/solr/indexes/fascinator/index
REM 7. %SOLR_BASE_DIR%/solr/indexes/security/index
REM show usage if no parameters given
if "%1" == "" goto usage
REM get fascinator home dir
for %%F in ("%0") do set TF_HOME=%%~dpF
REM set environment
call "%TF_HOME%tf_env.bat"
set Cmd=tasklist /fi "WINDOWTITLE eq The Fascinator - mvn*" /fo csv /nh
for /f "tokens=1*" %%i in ('%Cmd% ^| findstr "cmd.exe"') do goto running
if "%1" == "all" goto all
if "%1" == "solr" goto solr
:all
REM deleting all data
echo Deleting: %FASCINATOR_HOME%\storage
rd /s/q %FASCINATOR_HOME%\storage
echo ----
echo Deleting: %FASCINATOR_HOME%\activemq-data
rd /s/q %FASCINATOR_HOME%\activemq-data
echo ----
echo echo Deleting: %FASCINATOR_HOME%\logs
rd /s/q %FASCINATOR_HOME%\logs
echo ----
echo Deleting: %FASCINATOR_HOME%\database\fsHarvestCache
rd /s/q %FASCINATOR_HOME%\database\fsHarvestCache
echo ----
echo Deleting: %FASCINATOR_HOME%\cache
rd /s/q %FASCINATOR_HOME%\cache
echo ----
goto solr
:solr
REM deleting solr indexer
echo Deleting: %FASCINATOR_HOME%\solr\indexes\anotar\index
rd /s/q %SOLR_BASE_DIR%\solr\indexes\anotar\index
echo ----
echo Deleting: %FASCINATOR_HOME%\solr\indexes\fascinator\index
rd /s/q %SOLR_BASE_DIR%\solr\indexes\fascinator\index
echo ----
echo Deleting: %FASCINATOR_HOME%\solr\indexes\security\index
rd /s/q %SOLR_BASE_DIR%\solr\indexes\security\index
echo ----
goto end
:running
echo The Fascinator is RUNNING.
echo Please stop Fascinator by running "tf.bat stop" before you delete any data
goto end
:usage
echo Usage: %0 all^|solr
goto end
:end
endlocal