piler/util/indexer.attachment.sh
SJ b73a2765b6 move config files to sysconfdir/piler
Change-Id: I0e1a4df6cf54e10b407f7df8b58d94fe1ae87ed0
Signed-off-by: SJ <sj@acts.hu>
2016-09-18 10:17:59 +02:00

28 lines
689 B
Bash
Executable File

#!/bin/bash
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
DELTATMPFILE=/var/run/piler/delta.attachment.indexer.tmp
INDEXER="indexer --config SYSCONFDIR/piler/sphinx.conf"
PRIORITY=mail.error
TOUCHFILE=/var/piler/stat/indexer.attachment
if [ -f $DELTATMPFILE ]; then echo "INDEXER ERROR: att1 indexing is already running. It started at "`cat $DELTATMPFILE` | logger -p $PRIORITY ; exit 1; fi
date > $DELTATMPFILE
touch $TOUCHFILE
function finish {
rm -f $DELTATMPFILE
}
trap finish EXIT
echo "INDEXER INFO: indexing att1 started" | logger -p $PRIORITY
$INDEXER --quiet att1 --rotate
echo "INDEXER INFO: indexing att1 finished" | logger -p $PRIORITY