diff --git a/scripts/expenses/README b/scripts/expenses/README index e37c4de03f715ab8c34063286b8c3a8eb7670222..d121957d66e83c138268346ff083373da25c8145 100644 --- a/scripts/expenses/README +++ b/scripts/expenses/README @@ -1,6 +1,12 @@ The easiest way to insert expenses data is to use 'insert_expenses.sh'. Script's input: Year, month and day from the data to be inserted, ElasticSearch's user and password. The day should be the last day of the month. +The script also uses a config file named 'config.sh'. This is a small shell script that need to only declare some variables: index, host, filter and universities: +- Index: The index prefix to be saved on ElasticSearch. +- Host: The hostname of the machine runnning ElasticSearch. +- Filter: An array of n values, that will create n indexes in ElasticSearch, each one filtering data from Portal Transparencia using its corresponding string. Ex: "UNIVERSIDADE FEDERAL DO PARANA" +- University: An array of n values, with n being the same n as Filter's array. This array should contain the initials from Universities declared in Filter array, in the same order. + Example: ./insert_expenses.sh 2016 10 31 myuser mypass Example 2: ./insert_expenses.sh 2014 11 30 myuser mypass diff --git a/scripts/expenses/config.sh b/scripts/expenses/config.sh index 5c22af6e05072351cc14968da74a4c4614425525..49a1d8aad77bde4d317146b2e2664463104cfef7 100644 --- a/scripts/expenses/config.sh +++ b/scripts/expenses/config.sh @@ -5,7 +5,7 @@ index="gastos-pagamentos" # Filter: An array of strings that will be used on 'egrep' to filter data to get only relevant universities. -# University: An array of initials, corresponding to Filter. +# University: An array of initials, corresponding to Filter's array. They have to be in the same order! # Warning: Filter's length must be the same as university's!! filter=("UNIVERSIDADE FEDERAL DO PARANA" "UNIVERSIDADE FEDERAL DE MINAS GERAIS" "UNIVERSIDADE FEDERAL DE SANTA CATARINA" "UNIVERSIDADE FEDERAL DE PERNAMBUCO" "UNIVERSIDADE FEDERAL DE SANTA MARIA") diff --git a/scripts/insert_data.sh b/scripts/insert_data.sh index f50741ea2d080bf64b436f29b0524b3f705757f4..d6ff82d7aa5a45ff65d0bd8e19a65a20f70bae1e 100755 --- a/scripts/insert_data.sh +++ b/scripts/insert_data.sh @@ -1,4 +1,11 @@ # This script will call every script needed to insert data. +# Parameters are the year and month from the data that will be inserted, and an elasticsearch username and password. +# Also, scripts called by insert_data.sh use a config file, located in every subfolder and called 'config.sh'. +# Those config files have some variables that have to be set: +# - Index: The index prefix to be saved on ElasticSearch. +# - Host: The hostname of the machine runnning ElasticSearch. +# - Filter: An array of n values, that will create n indexes in ElasticSearch, each one filtering data from Portal Transparencia using its corresponding string. Ex: "UNIVERSIDADE FEDERAL DO PARANA" +# - University: An array of n values, with n being the same n as Filter's array. This array should contain the initials from Universities declared in Filter array, in the same order. if [ "$#" -ne 4 ]; then echo "Usage: $0 <year> <month> <user> <password>" diff --git a/scripts/travel_allowances/README b/scripts/travel_allowances/README index 165b1f695ea919c5099deee57cf67ae72dc097d8..b92d828e5d3d7d0265d1ba40a4f8c1bba8ca3290 100644 --- a/scripts/travel_allowances/README +++ b/scripts/travel_allowances/README @@ -1,6 +1,12 @@ The easiest way to insert travel allowance data is to use 'insert_travel_allowance.sh'. Script's input: Year and month from the data to be inserted, ElasticSearch's user and password. +The script also uses a config file named 'config.sh'. This is a small shell script that need to only declare some variables: index, host, filter and universities: +- Index: The index prefix to be saved on ElasticSearch. +- Host: The hostname of the machine runnning ElasticSearch. +- Filter: An array of n values, that will create n indexes in ElasticSearch, each one filtering data from Portal Transparencia using its corresponding string. Ex: "UNIVERSIDADE FEDERAL DO PARANA" +- University: An array of n values, with n being the same n as Filter's array. This array should contain the initials from Universities declared in Filter array, in the same order. + Example: ./insert_travel_allowance.sh 2016 10 myuser mypass Example 2: ./insert_travel_allowance.sh 2014 11 myuser mypass diff --git a/scripts/travel_allowances/config.sh b/scripts/travel_allowances/config.sh index 3cf088ac7b7385750d625f965de27c6c8ab55607..cb7e1cf33b351f9833c10b6e3e1bd4889b67ccb3 100644 --- a/scripts/travel_allowances/config.sh +++ b/scripts/travel_allowances/config.sh @@ -5,7 +5,7 @@ index="gastos-diarias" # Filter: An array of strings that will be used on 'egrep' to filter data to get only relevant universities. -# University: An array of initials, corresponding to Filter. +# University: An array of initials, corresponding to Filter's array. They have to be in the same order! # Warning: Filter's length must be the same as university's!! filter=("UNIVERSIDADE FEDERAL DO PARANA" "UNIVERSIDADE FEDERAL DE MINAS GERAIS" "UNIVERSIDADE FEDERAL DE SANTA CATARINA" "UNIVERSIDADE FEDERAL DE PERNAMBUCO" "UNIVERSIDADE FEDERAL DE SANTA MARIA") diff --git a/scripts/workers/README b/scripts/workers/README index 190ab41c8aca88dff24f803dc11c0a77df907aca..092d87e7d51d5606ce0f9d57fe9b5381fe302877 100644 --- a/scripts/workers/README +++ b/scripts/workers/README @@ -1,6 +1,12 @@ The easiest way to insert expenses data is to use 'insert_register_payment.sh'. Script's input: Year and Month from CSV file, ElasticSearch's user and password. +The script also uses a config file named 'config.sh'. This is a small shell script that need to only declare some variables: index, host, filter and universities: +- Index: The index prefix to be saved on ElasticSearch. +- Host: The hostname of the machine runnning ElasticSearch. +- Filter: An array of n values, that will create n indexes in ElasticSearch, each one filtering data from Portal Transparencia using its corresponding string. Ex: "UNIVERSIDADE FEDERAL DO PARANA" +- University: An array of n values, with n being the same n as Filter's array. This array should contain the initials from Universities declared in Filter array, in the same order. + Example (inserting data from file 20130930_Cadastro.csv): ./insert_register_payment.sh 2013 09 myuser mypassword If you want to look at more examples, check add_registers.sh. diff --git a/scripts/workers/config.sh b/scripts/workers/config.sh index 08395d690d9ca153ae490d3862704db17ce33712..28f0549b3564e43f9f3e6aee8b13d8cc85257440 100644 --- a/scripts/workers/config.sh +++ b/scripts/workers/config.sh @@ -5,7 +5,7 @@ index="servidores" # Filter: An array of strings that will be used on 'egrep' to filter data to get only relevant universities. -# University: An array of initials, corresponding to Filter. +# University: An array of initials, corresponding to Filter's array. They have to be in the same order! # Warning: Filter's length must be the same as university's!! filter=("UNIVERSIDADE FEDERAL DO PARANA" "UNIVERSIDADE FEDERAL DE MINAS GERAIS" "UNIVERSIDADE FEDERAL DE SANTA CATARINA" "UNIVERSIDADE FEDERAL DE PERNAMBUCO" "UNIVERSIDADE FEDERAL DE SANTA MARIA")