diff --git a/indexer/indexer-ciblage.sh b/indexer/indexer-ciblage.sh index ec14b18..d415ad1 100644 --- a/indexer/indexer-ciblage.sh +++ b/indexer/indexer-ciblage.sh @@ -6,8 +6,6 @@ MYSQL_HOST=192.168.3.30 MYSQL_USER=sphinx MYSQL_PASS=indexer -echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION CIBLAGE" >> $PATH_LOG/indexer.log - # Is consolidated ? output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-ciblage.sql) idx=''; @@ -21,6 +19,8 @@ idx=$(echo $idx|sed -e "s/^[idx ]*//g"||sed -e "s/[ ]*$//g") if [ -n "$idx" ]; then if [[ "$idx" > 0 ]]; then + echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION CIBLAGE" >> $PATH_LOG/indexer.log + # Enregistrement Debut Indexation mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 -e "UPDATE sphinx_idx SET indexingBegin=NOW() WHERE id=$idx" >> $PATH_LOG/indexer.log @@ -32,9 +32,9 @@ if [ -n "$idx" ]; then # Enregistrement Fin Indexation mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 -e "UPDATE sphinx_idx SET indexingEnd=NOW() WHERE id=$idx" >> $PATH_LOG/indexer.log + echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION CIBLAGE" >> $PATH_LOG/indexer.log + fi fi -echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION CIBLAGE" >> $PATH_LOG/indexer.log - diff --git a/indexer/indexer-dir.sh b/indexer/indexer-dir.sh index 26a2ef8..8307c67 100755 --- a/indexer/indexer-dir.sh +++ b/indexer/indexer-dir.sh @@ -6,8 +6,6 @@ MYSQL_HOST=192.168.3.30 MYSQL_USER=sphinx MYSQL_PASS=indexer -echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION DIR" >> $PATH_LOG/indexer.log - # Is consolidated ? output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-dir.sql) idx=''; @@ -21,6 +19,8 @@ idx=$(echo $idx|sed -e "s/^[idx ]*//g"||sed -e "s/[ ]*$//g") if [ -n "$idx" ]; then if [[ "$idx" > 0 ]]; then + echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION DIR" >> $PATH_LOG/indexer.log + # Enregistrement Debut Indexation mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 -e "UPDATE sphinx_idx SET indexingBegin=NOW() WHERE id=$idx" >> $PATH_LOG/indexer.log @@ -36,8 +36,8 @@ if [ -n "$idx" ]; then echo "$(date '+%Y-%m-%d %H:%M:%S') - Rotation Table - Debut" >> $PATH_LOG/indexer.log mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS jo < $PATH_SQL/rotate-dir.sql >> $PATH_LOG/indexer.log echo "$(date '+%Y-%m-%d %H:%M:%S') - Rotation Table - Fin" >> $PATH_LOG/indexer.log - + + echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION DIR" >> $PATH_LOG/indexer.log + fi fi - -echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION DIR" >> $PATH_LOG/indexer.log diff --git a/indexer/indexer-ent.sh b/indexer/indexer-ent.sh index f377be5..3b3a428 100755 --- a/indexer/indexer-ent.sh +++ b/indexer/indexer-ent.sh @@ -6,8 +6,6 @@ MYSQL_HOST=192.168.3.30 MYSQL_USER=sphinx MYSQL_PASS=indexer -echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION ENT" >> $PATH_LOG/indexer.log - # Is consolidated ? output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-ent.sql) idx=''; @@ -21,6 +19,8 @@ idx=$(echo $idx|sed -e "s/^[idx ]*//g"||sed -e "s/[ ]*$//g") if [ -n "$idx" ]; then if [[ "$idx" > 0 ]]; then + echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION ENT" >> $PATH_LOG/indexer.log + # Enregistrement Debut Indexation mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 -e "UPDATE sphinx_idx SET indexingBegin=NOW() WHERE id=$idx" >> $PATH_LOG/indexer.log @@ -37,7 +37,7 @@ if [ -n "$idx" ]; then mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS jo < $PATH_SQL/rotate-ent.sql >> $PATH_LOG/indexer.log echo "$(date '+%Y-%m-%d %H:%M:%S') - Rotation Table - Fin" >> $PATH_LOG/indexer.log + echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION ENT" >> $PATH_LOG/indexer.log + fi fi - -echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION ENT" >> $PATH_LOG/indexer.log diff --git a/indexer/sql/consolidate-ciblage.sql b/indexer/sql/consolidate-ciblage.sql index b52b843..2e14254 100644 --- a/indexer/sql/consolidate-ciblage.sql +++ b/indexer/sql/consolidate-ciblage.sql @@ -1,5 +1,5 @@ SELECT id FROM sphinx_idx -WHERE createEnd BETWEEN (NOW() - INTERVAL 1 HOUR) AND NOW() +WHERE createEnd BETWEEN (NOW() - INTERVAL 2 HOUR) AND NOW() AND nom = 'jo.etablissements_act' AND indexingBegin IS NULL AND indexingEnd IS NULL