From a1b71bddf201a9174773eb86411b27c506c63a93 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Wed, 15 Sep 2021 11:22:54 +0200 Subject: [PATCH] Added reindex.sh to util Signed-off-by: Janos SUTO --- util/reindex.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 util/reindex.sh diff --git a/util/reindex.sh b/util/reindex.sh new file mode 100755 index 00000000..121ca9ff --- /dev/null +++ b/util/reindex.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o pipefail + +INSTALL_PREFIX=/usr/local +THRESHOLD=100000000 + +start_id=1 +stop_id=5000000 + +while [[ $start_id -lt $stop_id ]]; do + y=$(( start_id + 9999 )) + echo $start_id $y + "${INSTALL_PREFIX}/bin/reindex" -f $start_id -t $y -p + "${INSTALL_PREFIX}/libexec/piler/indexer.delta.sh" + start_id=$(( start_id + 10000 )) + + if [[ "$(stat -c %s /var/piler/sphinx/dailydelta1.spp)" -gt "$THRESHOLD" ]]; then + "${INSTALL_PREFIX}/libexec/piler/indexer.main.sh" + fi +done