mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-26 08:00:12 +01:00
28 lines
649 B
Bash
28 lines
649 B
Bash
|
#!/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
|
||
|
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
|
||
|
|
||
|
|