-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_db.sh
27 lines (27 loc) · 930 Bytes
/
make_db.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
echo "fin_sanctions. DB creation and population"
echo "-----------------------------------------"
read -p "Creating db backup. The old backup will be deleted!. Press Ctrl+C to abort or Enter to proceed."
echo "Deleting old backup"
rm fin_sanctions/list.db.old
echo "Creating new backup"
mv fin_sanctions/list.db fin_sanctions/list.db.old
echo "Touching new db"
cd fin_sanctions
sqlite3 list.db
cd ..
echo "Creating new (empty) db"
python make_db.py
echo "Downloading lists"
cd fin_sanctions/lists
echo "EU list"
wget -N http://ec.europa.eu/external_relations/cfsp/sanctions/list/version4/global/global.xml
echo "UN list"
wget -N https://www.un.org/sc/suborg/sites/www.un.org.sc.suborg/files/consolidated.xml
cd ../..
echo "Populating new db with EU list"
python parse_list_eu.py
echo "Populating new db with UN list"
python parse_list_un.py
echo "Vocabulary"
python create_vocabulary.py
echo "Terminated. Please look for errors."