Skip to content
Snippets Groups Projects
Commit 91c103f9 authored by Cristian Weiland's avatar Cristian Weiland
Browse files

Issue #25: Improve documentation from scripts

parent 0f634a06
No related branches found
No related tags found
No related merge requests found
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
......
......@@ -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")
......
# 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>"
......
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
......
......@@ -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")
......
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.
......
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment