-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bash script to start indexerclient based on Metafacture
- Loading branch information
guenter hipler
committed
Sep 25, 2018
1 parent
d5b711f
commit c67f4f1
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env bash | ||
|
||
cwd=`pwd` | ||
|
||
LOGDIR=$cwd/log | ||
LOGFILE=$LOGDIR/post2solr.log | ||
|
||
|
||
export METAFACTURE_HOME=$cwd | ||
|
||
|
||
|
||
function usage() | ||
{ | ||
printf "usage: $0 [-i <content input directory>\n" | ||
} | ||
|
||
|
||
function preChecks() | ||
{ | ||
|
||
[ ! -d "$LOGDIR" ] && mkdir -p $LOGDIR && printf "Logdir created ...\n" | ||
[ ! -d "$1" ] && printf "inputdir $1 not available ...\n" && usage && exit 9 | ||
|
||
printf "prechecks finished ...\n" | ||
|
||
} | ||
|
||
|
||
function runIndexing() | ||
{ | ||
|
||
echo "given inputdir: $1" | ||
|
||
#[ ! -d "$LOGDIR" ] && mkdir -p $LOGDIR && printf "Logdir created ...\n" >> $LOGFILE | ||
[ ! -d "$1" ] && echo "inputdir $1 not available ...\n" && exit 9 | ||
|
||
printf "start indexing ...\n\n" | ||
|
||
./flux.sh fluxscripts/indexsolr.flux \ | ||
dir2read=$1 | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
#it seems getopts doesn't run in within function scope... | ||
while getopts hi: OPTION | ||
do | ||
case $OPTION in | ||
h) usage | ||
exit 9 | ||
;; | ||
i) INPUTDIR=$OPTARG;; | ||
|
||
*) printf "unknown option -%c\n" $OPTION; usage; exit;; | ||
esac | ||
done | ||
|
||
preChecks $INPUTDIR | ||
runIndexing $INPUTDIR | ||
|