Appeler :
- recherche.pl 1 toutes les 24 h
- recherche.pl 0 tous les 1/4 h
Attention ! Bien penser à mettre le flag (/tmp/flag_recherche) à 1 quand on change nom ou prénom ou
épouse.
Il faudra aussi bien vérifier que ça fonctionne vis-à-vis des droits au passage en prod.
--- /dev/null
+#! /usr/bin/perl -w
+
+my $mode = shift;
+#mode 1 = mise à jour obligatoire
+#mode autre = mise à jour si flag
+
+my @args = ("mysql x4dat <recherche.sql");
+
+if ($mode==1) {
+ system(@args);
+}
+else {
+ open(INFILE,'</tmp/flag_recherche');
+ $_ = <INFILE>;
+ system(@args)
+ if (/1/);
+ close INFILE;
+ open(OUTFILE,'>/tmp/flag_recherche');
+ print OUTFILE "0";
+ close OUTFILE;
+}
--- /dev/null
+USE x4dat;
+DROP TABLE recherche;
+CREATE TABLE recherche SELECT i.matricule AS matricule,LOWER(REPLACE(i.nom,'-',' ')) AS nom1,
+LOWER(REPLACE(u.nom,'-',' ')) AS nom2, LOWER(REPLACE(u.epouse,'-',' ')) AS nom3,
+LOWER(REPLACE(i.prenom,'-',' ')) AS prenom1, LOWER(REPLACE(u.prenom,'-',' ')) AS prenom2,i.promo AS
+promo FROM identification AS i LEFT JOIN auth_user_md5 AS u ON (u.matricule=i.matricule);