X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=zebra%2FMakefile;h=c6a73cbb467fcfec4d54cdf72a628221cb33c6e7;hp=85a400cddfc71e08e832db003b654ff500d95144;hb=bd2f592e1e7cae6c69be6713f0dd2a0d3a210612;hpb=5e2701a398bc21f09ea008cf9f70fbf6d9d02943 diff --git a/zebra/Makefile b/zebra/Makefile index 85a400c..c6a73cb 100644 --- a/zebra/Makefile +++ b/zebra/Makefile @@ -1,10 +1,14 @@ -IRSPY_ARCHIVE= records-2010-04-06 +IRSPY_ARCHIVE= records-2013-08-13 IRSPY_ARCHIVE_EXT= .tar.gz DUMP_DIR= irspy-dump ZEBRA_DIR= db ZEBRAIDX= zebraidx-2.0 ZEBRAIDX_TEST= zebraidx-2.0 -c zebra-test.cfg +IRSPY_DATABASE= $${IRSpyDbName-"localhost:8018/IR-Explain---1"} +ZEBRA_LOGFILE= irspy-zebra.log +ZEBRA_PID_FILE= ${ZEBRA_DIR}/lock/zebrasrv.pid + # debugging ZEBRA_TEST_DIR= db-test @@ -36,20 +40,34 @@ newdb-test: ${ZEBRAIDX_TEST} update ${IRSPY_ARCHIVE} ${ZEBRAIDX_TEST} commit +# note: the test database use localhost:8019/IR-Explain---1 dump: rm -rf records-${DATE}.old -test -e records-${DATE} && mv records-${DATE} records-${DATE}.old mkdir records-${DATE} - cd records-${DATE} && ../../bin/irspy-dump.pl localhost:8018/IR-Explain---1 - cd records-${DATE} && ( for i in *.xml; do tidy -xml -i -m -w 140 $$i; done ) > /dev/null 2>&1 - tar cf - records-${DATE} | gzip > records-${DATE}.tgz + cd records-${DATE} && ../../bin/irspy-dump.pl ${IRSPY_DATABASE} + cd records-${DATE}; find . -name '*.xml' -print0 | \ + xargs -n1 -0 -P4 tidy -xml -i -m -w 140 > /dev/null 2>&1 + tar cf - records-${DATE} | gzip > records-${DATE}.tar.gz clean: rm -f terse.properties +start-zebra: + zebrasrv-2.0 -f yazserver.xml > ${ZEBRA_LOGFILE} 2>&1 & + +stop-zebra: + kill `cat ${ZEBRA_PID_FILE}` + sleep 0.5 + -kill -9 `cat ${ZEBRA_PID_FILE}` + +check: newdb start-zebra dump stop-zebra distclean + distclean: clean - rm -rf ${IRSPY_ARCHIVE} ${ZEBRA_DIR} ${ZEBRA_DIR} + rm -rf ${IRSPY_ARCHIVE} ${ZEBRA_DIR} ${ZEBRA_DIR} ${ZEBRA_TEST_DIR} ${ZEBRA_LOGFILE} help: - @echo "make [ dump | test | newdb | newdb-test | clean | distclean ]" + @echo "make [ newdb | newdb-test | dump | check ]" + @echo " [ start-zebra | stop-zebra ]" + @echo " [ clean | distclean ]"