forked from jsuto/piler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
MAINTMPFILE=/var/run/piler/main.indexer.tmp | ||
DELTATMPFILE=/var/run/piler/delta.indexer.tmp | ||
INDEXER=`which indexer` | ||
PRIORITY=mail.error | ||
|
||
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 | ||
|
||
if [ -f $DELTATMPFILE ]; then echo "INDEXER ERROR: delta indexing and merging is already running. It started at "`cat $DELTATMPFILE` | logger -p $PRIORITY ; exit 1; fi | ||
|
||
date > $DELTATMPFILE | ||
|
||
function finish { | ||
rm -f $DELTATMPFILE | ||
} | ||
|
||
trap finish EXIT | ||
|
||
echo "INDEXER INFO: indexing delta1 started" | logger -p $PRIORITY | ||
|
||
5,35 2-23 * * * /usr/local/bin/indexer --quiet delta1 --rotate && sleep 2 && /usr/local/bin/indexer --quiet --merge dailydelta1 delta1 --merge-dst-range deleted 0 0 --rotate | ||
|
||
$INDEXER --quiet delta1 --rotate | ||
|
||
echo "INDEXER INFO: indexing delta1 finished" | logger -p $PRIORITY | ||
|
||
sleep 5 | ||
|
||
echo "INDEXER INFO: merging delta to dailydelta started" | logger -p $PRIORITY | ||
|
||
$INDEXER --quiet --merge dailydelta1 delta1 --merge-dst-range deleted 0 0 --rotate | ||
|
||
echo "INDEXER INFO: merging delta to dailydelta finished" | logger -p $PRIORITY | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
MAINTMPFILE=/var/run/piler/main.indexer.tmp | ||
#MAINTMPFILE=/tmp/main.indexer.tmp | ||
INDEXER=`which indexer` | ||
PRIORITY=mail.error | ||
|
||
if [ -f $MAINTMPFILE ]; then echo "ERROR: indexer merging to main index is already running. It started at "`cat $MAINTMPFILE` | logger -p $PRIORITY ; exit 1; fi | ||
|
||
date > $MAINTMPFILE | ||
|
||
function finish { | ||
rm -f $MAINTMPFILE | ||
} | ||
|
||
trap finish EXIT | ||
|
||
echo "INFO: merging to main started" | logger -p $PRIORITY | ||
|
||
$INDEXER --quiet --merge main1 dailydelta1 --merge-dst-range deleted 0 0 --rotate | ||
|
||
echo "INFO: merging to main finished" | logger -p $PRIORITY | ||
|
||
sleep 5 | ||
|
||
echo "INFO: resetting daily delta started" | logger -p $PRIORITY | ||
|
||
$INDEXER --quiet dailydelta1 --rotate | ||
|
||
echo "INFO: resetting daily delta finished" | logger -p $PRIORITY | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters