mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-26 09:20:13 +01:00
754a0ca632
Change-Id: I682745cac75ebf665e292165b45c5ba324c67f87 Signed-off-by: SJ <sj@acts.hu>
35 lines
928 B
Bash
Executable File
35 lines
928 B
Bash
Executable File
#!/bin/bash
|
|
|
|
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
|
|
MAINTMPFILE=/var/run/piler/main.indexer.tmp
|
|
INDEXER="indexer --config SYSCONFDIR/piler/sphinx.conf"
|
|
PRIORITY=mail.error
|
|
TOUCHFILE=/var/piler/stat/indexer
|
|
|
|
if [ -f $MAINTMPFILE ]; then echo "INDEXER ERROR: indexer merging to main index is already running. It started at "`cat $MAINTMPFILE` | logger -p $PRIORITY ; exit 1; fi
|
|
|
|
date > $MAINTMPFILE
|
|
|
|
touch $TOUCHFILE
|
|
|
|
function finish {
|
|
rm -f $MAINTMPFILE
|
|
}
|
|
|
|
trap finish EXIT
|
|
|
|
echo "INDEXER INFO: merging to main started" | logger -p $PRIORITY
|
|
|
|
$INDEXER --quiet --merge main1 dailydelta1 --merge-dst-range deleted 0 0 --rotate
|
|
|
|
echo "INDEXER INFO: merging to main finished" | logger -p $PRIORITY
|
|
|
|
sleep 5
|
|
|
|
echo "INDEXER INFO: resetting daily delta started" | logger -p $PRIORITY
|
|
|
|
$INDEXER --quiet dailydelta1 --rotate
|
|
|
|
echo "INDEXER INFO: resetting daily delta finished" | logger -p $PRIORITY
|
|
|