35b4b6af75e027d72085d6bba6154d2a3906e286
[platal.git] / modules / fusionax / import-ax.sh
1 #! /bin/bash
2
3 # import des données
4 scp -i ax_xorg_rsa xorg@polytechniciens.com:/home/axasso/ax-import/export_4D.txt.rar .
5 unrar e -inul export_4D.txt.rar
6
7 # séparation en fichiers de tables
8 cat export-total* | grep ^AD > Adresses.txt
9 cat export-total* | grep ^AN > Anciens.txt
10 cat export-total* | grep ^FO > Formations.txt
11 cat export-total* | grep ^AC > Activites.txt
12 cat export-total* | grep ^EN > Entreprises.txt
13
14 exit 1
15
16 # intégration dans notre bdd
17 echo intégration dans notre bdd
18 $MYSQL x4dat < Activites.sql
19 $MYSQL x4dat < Adresses.sql
20 $MYSQL x4dat < Anciens.sql
21 $MYSQL x4dat < Formations.sql
22 $MYSQL x4dat < Entreprises.sql
23
24 # nettoyage
25 echo nettoyage
26 rm Adresses.txt Anciens.txt Formations.txt Activites.txt Entreprises.txt export_4D.txt.rar export-total*