Scripts is validated

This commit is contained in:
Michael RICOIS 2014-04-22 08:38:41 +00:00
parent 418318bd01
commit cb0229ae48
4 changed files with 14 additions and 14 deletions

View File

@ -6,8 +6,6 @@ MYSQL_HOST=192.168.3.30
MYSQL_USER=sphinx MYSQL_USER=sphinx
MYSQL_PASS=indexer MYSQL_PASS=indexer
echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION CIBLAGE" >> $PATH_LOG/indexer.log
# Is consolidated ? # Is consolidated ?
output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-ciblage.sql) output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-ciblage.sql)
idx=''; idx='';
@ -21,6 +19,8 @@ idx=$(echo $idx|sed -e "s/^[idx ]*//g"||sed -e "s/[ ]*$//g")
if [ -n "$idx" ]; then if [ -n "$idx" ]; then
if [[ "$idx" > 0 ]]; then if [[ "$idx" > 0 ]]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION CIBLAGE" >> $PATH_LOG/indexer.log
# Enregistrement Debut Indexation # 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 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 # 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 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
fi fi
echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION CIBLAGE" >> $PATH_LOG/indexer.log

View File

@ -6,8 +6,6 @@ MYSQL_HOST=192.168.3.30
MYSQL_USER=sphinx MYSQL_USER=sphinx
MYSQL_PASS=indexer MYSQL_PASS=indexer
echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION DIR" >> $PATH_LOG/indexer.log
# Is consolidated ? # Is consolidated ?
output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-dir.sql) output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-dir.sql)
idx=''; idx='';
@ -21,6 +19,8 @@ idx=$(echo $idx|sed -e "s/^[idx ]*//g"||sed -e "s/[ ]*$//g")
if [ -n "$idx" ]; then if [ -n "$idx" ]; then
if [[ "$idx" > 0 ]]; then if [[ "$idx" > 0 ]]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION DIR" >> $PATH_LOG/indexer.log
# Enregistrement Debut Indexation # 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 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-dir.sql >> $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') - Rotation Table - Fin" >> $PATH_LOG/indexer.log
echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION DIR" >> $PATH_LOG/indexer.log
fi fi
fi fi
echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION DIR" >> $PATH_LOG/indexer.log

View File

@ -6,8 +6,6 @@ MYSQL_HOST=192.168.3.30
MYSQL_USER=sphinx MYSQL_USER=sphinx
MYSQL_PASS=indexer MYSQL_PASS=indexer
echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION ENT" >> $PATH_LOG/indexer.log
# Is consolidated ? # Is consolidated ?
output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-ent.sql) output=$(mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS sdv1 < $PATH_SQL/consolidate-ent.sql)
idx=''; idx='';
@ -21,6 +19,8 @@ idx=$(echo $idx|sed -e "s/^[idx ]*//g"||sed -e "s/[ ]*$//g")
if [ -n "$idx" ]; then if [ -n "$idx" ]; then
if [[ "$idx" > 0 ]]; then if [[ "$idx" > 0 ]]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') === INDEXATION ENT" >> $PATH_LOG/indexer.log
# Enregistrement Debut Indexation # 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 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 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') - Rotation Table - Fin" >> $PATH_LOG/indexer.log
echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION ENT" >> $PATH_LOG/indexer.log
fi fi
fi fi
echo "$(date '+%Y-%m-%d %H:%M:%S') === FIN INDEXATION ENT" >> $PATH_LOG/indexer.log

View File

@ -1,5 +1,5 @@
SELECT id FROM sphinx_idx 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 nom = 'jo.etablissements_act'
AND indexingBegin IS NULL AND indexingBegin IS NULL
AND indexingEnd IS NULL AND indexingEnd IS NULL