Configuration, Nouvelle version, etc

This commit is contained in:
Michael RICOIS 2011-12-08 09:17:06 +00:00
commit 18bf89747d
19 changed files with 445 additions and 110 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
allVersion=("2.0.1" "0.9.9")
allVersion=("2.0.1" "0.9.9" "2.0.2")
declare -A ERREURS
declare -A ASTUCES
@ -32,7 +32,7 @@ ASTUCES=(
function loadIndication() {
while [ -d "/proc/$1" ]
do #Current PID in /proc |
do #Current PID in /proc
echo -en "Loading... /\033[1G"; sleep .07
echo -en "Loading... -\033[1G"; sleep .07
echo -en "Loading... / \033[1G"; sleep .07
@ -70,12 +70,14 @@ then
if [ ! -e /dbs/sphinxlog ];then `mkdir /dbs/sphinxlog`; fi
if [ ! -e /init.d/sphinxsearch ];then `cp initscript/sphinxsearch /etc/init.d/ > /dev/null` ;`chmod +x /etc/init.d/sphinxsearch > /dev/null`; `update-rc.d sphinxsearch defaults > /dev/null`; fi
if [ ! -e config/${HOSTNAME} ];then `mkdir config/${HOSTNAME}`;fi
if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ]
if [ ! -e sphinx-2.0.1.tar.gz ] || [ ! -e sphinx-0.9.9.tar.gz ] || [ ! -e sphinx-2.0.2.tar.gz ]
then
if [ ! -z $2 ]; then
if [ $2 == "2.0.1" ]; then
version="$2-beta"
elif [ $2 == "0.9.9" ]; then
version="$2-beta"
elif [ $2 == "2.0.2" ]; then
version="$2"
else
echo -e $ROUGE"[Erreur]: This version not exist !"$NORMAL

View File

@ -0,0 +1,32 @@
source source_act
{
type = mysql
sql_host = 192.168.78.230
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = \
SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \
source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \
FROM liens \
WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old);
sql_attr_uint = actif
sql_attr_uint = source
sql_attr_uint = PminNum
sql_attr_str2ordinal= MajMin
sql_attr_str2ordinal= PpPm
sql_attr_str2ordinal= Pays
}
index act
{
source = source_act
path = /dbs/sphinx/act
docinfo = extern
morphology = none
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -0,0 +1,37 @@
source dir
{
type = mysql
sql_host = 192.168.78.230
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = \
SELECT id, siren, adr_dep, typeDir, dirSiren, civilite, CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \
YEAR(naissance_date) AS naiss_annee, \
MONTH(naissance_date) AS naiss_mois, \
DAY(naissance_date) AS naiss_jour, \
naissance_lieu, fonction_code, actif \
FROM dirigeants;
sql_attr_str2ordinal = civilite
sql_attr_str2ordinal = typeDir
sql_attr_str2ordinal = fonction_code
sql_attr_uint = dirSiren
sql_attr_uint = naiss_annee
sql_attr_uint = naiss_mois
sql_attr_uint = naiss_jour
sql_attr_uint = actif
sql_attr_uint = adr_dep
}
index dir
{
source = dir
path = /dbs/sphinx/dir
docinfo = extern
morphology = none
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -0,0 +1,37 @@
source dir
{
type = mysql
sql_host = 192.168.78.230
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = \
SELECT id, siren, adr_dep, typeDir, dirSiren, civilite, CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \
YEAR(naissance_date) AS naiss_annee, \
MONTH(naissance_date) AS naiss_mois, \
DAY(naissance_date) AS naiss_jour, \
naissance_lieu, fonction_code, actif \
FROM dirigeants_tmp;
sql_attr_str2ordinal = civilite
sql_attr_str2ordinal = typeDir
sql_attr_str2ordinal = fonction_code
sql_attr_uint = dirSiren
sql_attr_uint = naiss_annee
sql_attr_uint = naiss_mois
sql_attr_uint = naiss_jour
sql_attr_uint = actif
sql_attr_uint = adr_dep
}
index dir
{
source = dir
path = /dbs/sphinx/dir
docinfo = extern
morphology = none
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -0,0 +1,40 @@
source ent
{
type = mysql
sql_host = 192.168.78.230
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\
' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \
actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \
adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \
FROM etablissements;
sql_attr_str2ordinal = adr_typeVoie
sql_attr_uint = siren
sql_attr_uint = nic
sql_attr_uint = siege
sql_attr_uint = adr_num
sql_attr_uint = adr_cp
sql_attr_uint = adr_dep
sql_attr_uint = actif
sql_attr_uint = cj
sql_attr_uint = sirenValide
sql_attr_uint = rang
}
index ent
{
source = ent
path = /dbs/sphinx/ent
docinfo = extern
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -0,0 +1,41 @@
source ent
{
type = mysql
sql_host = 192.168.78.230
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\
' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \
actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \
adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \
FROM etablissements_tmp;
sql_attr_str2ordinal = adr_typeVoie
sql_attr_uint = siren
sql_attr_uint = nic
sql_attr_uint = siege
sql_attr_uint = adr_num
sql_attr_uint = adr_cp
sql_attr_uint = adr_dep
sql_attr_uint = actif
sql_attr_uint = cj
sql_attr_uint = sirenValide
sql_attr_uint = rang
}
index ent
{
source = ent
path = /dbs/sphinx/ent
docinfo = extern
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -0,0 +1,23 @@
source histo
{
type = mysql
sql_host = 192.168.78.230
sql_user = sphinx_histo
sql_pass = sphinx
sql_db = histobodacc
sql_port = 3306 # optional, default is 3306
sql_query = SELECT id, nomFichier, annee1, dateBod, texte FROM bodacc_ocr;
sql_attr_uint = annee1
sql_query_info = SELECT * FROM bodacc_ocr WHERE id=$id
}
index histo
{
source = histo
path = /home/sphinx/histo
docinfo = extern
morphology = none
min_word_len = 1
charset_type = sbcs
html_strip = 1
}

View File

@ -1,20 +1,20 @@
source source_ent
source ent
{
type = mysql
sql_host = 192.168.78.230
sql_host = 192.168.3.30
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\
' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \
actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \
adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \
FROM etablissements_tmp;
' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \
actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \
adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \
FROM etablissements;
sql_attr_str2ordinal = adr_typeVoie
sql_attr_uint = siren
sql_attr_uint = nic
@ -26,16 +26,15 @@ FROM etablissements_tmp;
sql_attr_uint = cj
sql_attr_uint = sirenValide
sql_attr_uint = rang
}
index ent
{
source = source_ent
source = ent
path = /dbs/sphinx/ent
docinfo = extern
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -0,0 +1,41 @@
source ent
{
type = mysql
sql_host = 192.168.3.30
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = SELECT id, siren, nic, siege, CONCAT(raisonSociale,\
' "" ',enseigne,' "" ',sigle,' "" ',identite_pre,' "" ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,' ',''),\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.',''),' ',\
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(sigle,\
'@','A'), '&',' ET '),'/',''),',',''),'-',''),'.','')) AS nom, adr_dep, \
actif, adr_num, adr_typeVoie, CONCAT(adr_libVoie,' ',adr_comp) AS adresse, adr_cp, \
adr_ville AS ville, cj, ape_etab, (siren>200) AS sirenValide, rang \
FROM etablissements_tmp;
sql_attr_str2ordinal = adr_typeVoie
sql_attr_uint = siren
sql_attr_uint = nic
sql_attr_uint = siege
sql_attr_uint = adr_num
sql_attr_uint = adr_cp
sql_attr_uint = adr_dep
sql_attr_uint = actif
sql_attr_uint = cj
sql_attr_uint = sirenValide
sql_attr_uint = rang
}
index ent
{
source = ent
path = /dbs/sphinx/ent
docinfo = extern
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -6,7 +6,8 @@ source source_act
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \
sql_query = \
SELECT id, Siren1, RaisonSociale, Siren2, actif, dateLien, IF(dateUpdate>dateInsert,dateUpdate,dateInsert) as dateMaj, \
source, Pmin*1 AS PminNum, MajMin, PpPm, IF(Pays='','FRA',Pays) AS Pays \
FROM liens \
WHERE ActionPart=1 AND Siren1>1000 AND Siren1 IN (SELECT DISTINCT SIREN FROM etablissements_old);
@ -26,6 +27,6 @@ index act
morphology = none
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -1,45 +0,0 @@
source source_dir
{
type = mysql
sql_host = 192.168.3.30
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = SELECT id, siren, actif, \
IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \
CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \
YEAR(naissance_date) AS naiss_annee, \
MONTH(naissance_date) AS naiss_mois, \
DAY(naissance_date) AS naiss_jour, \
naissance_lieu, adr_dep \
FROM rncs_dirigeants;
# UNION \
#SELECT id, siren, 0 AS actif, \
#'' AS genre, \
#CONCAT(nom,' ',nomUsage,' ',rs) AS nom, prenom, \
#0 AS naiss_annee, \
#0 AS naiss_mois, \
#0 AS naiss_jour, \
#'' AS naissance_lieu, 0 AS adr_dep \
#FROM bodacc_dirigeants_histo;
sql_attr_uint = naiss_annee
sql_attr_uint = naiss_mois
sql_attr_uint = naiss_jour
sql_attr_uint = actif
sql_attr_uint = genre
sql_attr_uint = adr_dep
}
index dir
{
source = source_dir
path = /dbs/sphinx/dir
docinfo = extern
morphology = none
#ispell_aff = /usr/local/sphinx/etc/francais.aff
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -0,0 +1,37 @@
source dir
{
type = mysql
sql_host = 192.168.3.30
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = \
SELECT id, siren, adr_dep, typeDir, dirSiren, civilite, CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \
YEAR(naissance_date) AS naiss_annee, \
MONTH(naissance_date) AS naiss_mois, \
DAY(naissance_date) AS naiss_jour, \
naissance_lieu, fonction_code, actif \
FROM dirigeants_tmp;
sql_attr_str2ordinal = civilite
sql_attr_str2ordinal = typeDir
sql_attr_str2ordinal = fonction_code
sql_attr_uint = dirSiren
sql_attr_uint = naiss_annee
sql_attr_uint = naiss_mois
sql_attr_uint = naiss_jour
sql_attr_uint = actif
sql_attr_uint = adr_dep
}
index dir
{
source = source_dir
path = /dbs/sphinx/dir
docinfo = extern
morphology = none
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \
U+C0..U+DE->U+E0..U+FE, U+DF, U+E0..U+FF
}

View File

@ -1,7 +1,7 @@
ource histo
source histo
{
type = mysql
sql_host = 192.168.78.230
sql_host = 192.168.3.24
sql_user = sphinx_histo
sql_pass = sphinx
sql_db = histobodacc

View File

@ -1,24 +1,26 @@
source source_dir
source dir
{
type = mysql
sql_host = 192.168.3.24
sql_host = 192.168.3.30
sql_user = sphinx
sql_pass = indexer
sql_db = jo
sql_query_pre =
sql_query = SELECT id, siren, actif, \
IF(civilite='M',1,IF(civilite='MME' OR civilite='MLLE',2,0)) AS genre, \
CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \
sql_query = \
SELECT id, siren, adr_dep, typeDir, dirSiren, civilite, CONCAT(nom,' ',naissance_nom, ' ', dirRS) AS nom, prenom, \
YEAR(naissance_date) AS naiss_annee, \
MONTH(naissance_date) AS naiss_mois, \
DAY(naissance_date) AS naiss_jour, \
naissance_lieu, adr_dep \
FROM rncs_dirigeants;
naissance_lieu, fonction_code, actif \
FROM dirigeants;
sql_attr_str2ordinal = civilite
sql_attr_str2ordinal = typeDir
sql_attr_str2ordinal = fonction_code
sql_attr_uint = dirSiren
sql_attr_uint = naiss_annee
sql_attr_uint = naiss_mois
sql_attr_uint = naiss_jour
sql_attr_uint = actif
sql_attr_uint = genre
sql_attr_uint = adr_dep
}
@ -28,7 +30,6 @@ index dir
path = /dbs/sphinx/dir
docinfo = extern
morphology = none
#ispell_aff = /usr/local/sphinx/etc/francais.aff
charset_type = sbcs
charset_table = 0..9, A..Z->a..z, a..z, \
U+23, U+25, U+26, U+2B, U+3D, U+40, \

View File

@ -23,7 +23,8 @@ Class configure
$i = 1;
while($file = readdir($dir)) {
if($file != '.' and $file != '..') {
$extension = explode('.', $file);
if($file != '.' and $file != '..' and $extension[1] == 'conf') {
echo "\t\t".'['.$i.'] '. $file."\n";
$this->indexes[$i] = $file;$i++;
}

9
indexer/indexerAct.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
PATH_BIN=/usr/local/sphinx/bin
PATH_LOG=/dbs/sphinxlog
DATE=`date '+%Y-%m-%d %H-%M-%S'`
echo "DEBUT de l'indexation ==== $(date +%H:%M:%S)" >> $PATH_LOG/indexerAct-$(date +%F).log
$PATH_BIN/indexer --rotate act act_phx >> $PATH_LOG/indexerAct-$(date +%F).log
echo "FIN ===== $(date +%H:%M:%S)" >> $PATH_LOG/indexerAct-$(date +%F).log

37
indexer/indexerDiri.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
PATH_BIN=/usr/local/sphinx/bin
PATH_LOG=/dbs/sphinxlog
DATE=`date '+%Y-%m-%d %H-%M-%S'`
echo "DEBUT de l'indexation ==== $(date +%H:%M:%S)" >> $PATH_LOG/indexerDiri-$(date +%F).log
# nombre de lignes dans la table etab
output=$(mysql -h192.168.3.30 -usphinx -pindexer jo < sql/countDiri.sql)
for line in "$output"; do
etab="$line"
done
# Suppression fin de ligne
etab=$(echo $etab|sed -e "s/^[etab ]*//g"||sed -e "s/[ ]*$//g")
# nombre de lignes dans la table diri_tmp
output=$(mysql -h192.168.3.30 -usphinx -pindexer jo < sql/countDiri_tmp.sql)
for line in "$output"; do
etab_tmp="$line"
done
# Suppression fin de ligne
etab_tmp=$(echo $etab_tmp|sed -e "s/^[etab_tmp ]*//g"||sed -e "s/[ ]*$//g")
# Comparaison du nombre de lignes entre etab (ancien) et etab_tmp (nouveau)
if test $etab_tmp -gt $etab; then
echo "Il y a $etab_tmp lignes dans la nouvelle table dirigeants ($etab lignes dans l'ancienne)" >> $PATH_LOG/indexerDiri-$(date +%F).log
$PATH_BIN/indexer --rotate dir dir_phx >> $PATH_LOG/indexerDiri-$(date +%F).log
echo "Sphinx - termine : $(date +%H:%M:%S)" >> $PATH_LOG/indexerDiri-$(date +%F).log
mysql -f -usphinx -h192.168.3.30 -pindexer jo < sql/finIndexationDiri.sql >> $PATH_LOG/indexerDiri-$(date +%F).log
else
# Il y a plus de lignes dans l'ancienne table dirigeants ==> On ne fait rien
echo "Il n'y a pas assez de lignes dans la nouvelle table dirigeants ($etab_tmp / $etab) !" >> $PATH_LOG/indexerDiri-$(date +%F).log
exit
fi
echo "FIN ===== $(date +%H:%M:%S)" >> $PATH_LOG/indexerDiri-$(date +%F).log

42
indexer/indexerEtab.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
PATH_BIN=/usr/local/sphinx/bin
PATH_LOG=/dbs/sphinxlog
DATE=`date '+%Y-%m-%d %H-%M-%S'`
echo "DEBUT de l'indexation ==== $(date +%H:%M:%S)" >> $PATH_LOG/indexerEtab-$(date +%F).log
# nombre de lignes dans la table etab
output=$(mysql -h192.168.3.30 -usphinx -pindexer jo < sql/countEtab.sql)
for line in "$output"; do
etab="$line"
done
# Suppression fin de ligne
etab=$(echo $etab|sed -e "s/^[etab ]*//g"||sed -e "s/[ ]*$//g")
# Cast de la variable au cas ou
#etab=$(echo $etab| gawk '{print + 0}')
# nombre de lignes dans la table etab_tmp
output=$(mysql -h192.168.3.30 -usphinx -pindexer jo < sql/countEtab_tmp.sql)
for line in "$output"; do
etab_tmp="$line"
done
# Suppression fin de ligne
etab_tmp=$(echo $etab_tmp|sed -e "s/^[etab_tmp ]*//g"||sed -e "s/[ ]*$//g")
# Cast de la variable au cas ou
#etab_tmp=$(echo $etab_tmp| gawk '{print + 0}')
# Comparaison du nombre de lignes entre etab (ancien) et etab_tmp (nouveau)
if test $etab_tmp -gt $etab; then
echo "Il y a $etab_tmp lignes dans la nouvelle table etablissement ($etab lignes dans l'ancienne)" >> $PATH_LOG/indexerEtab-$(date +%F).log
# $PATH_BIN/indexer --rotate --all >> $PATH_LOG/indexer-$(date +%F).log
$PATH_BIN/indexer --rotate ent ent_mns ent_phx >> $PATH_LOG/indexerEtab-$(date +%F).log
echo "Sphinx - terminé : $(date +%H:%M:%S)" >> $PATH_LOG/indexerEtab-$(date +%F).log
mysql -f -usphinx -h192.168.3.30 -pindexer jo < sql/finIndexationEtab.sql >> $PATH_LOG/indexerEtab-$(date +%F).log
else
# Il y a plus de lignes dans l'ancienne table etablissements ==> On ne fait rien
echo "Il n'y a pas assez de lignes dans la nouvelle table etablissement ($etab_tmp / $etab) !" >> $PATH_LOG/indexerEtab-$(date +%F).log
exit
fi
echo "FIN ===== $(date +%H:%M:%S)" >> $PATH_LOG/indexerEtab-$(date +%F).log

Binary file not shown.