Skip to content

Commit

Permalink
Merge pull request #25 from rafaelpezzuto/fix-script-gen-pt
Browse files Browse the repository at this point in the history
Corrige script bash para gera pré-tabelas em lote
  • Loading branch information
rafaelpezzuto authored Mar 2, 2022
2 parents 634c9dc + 4c0b801 commit 75fd6cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions scripts/batch_generate_pretable.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
#!/usr/bin/env bash
help(){
echo "SciELO Usage COUNTER - Batch script Generate Pretable"
echo "Please, inform the directory of logs (parameter -d). For example: "
echo "Please, inform the output directory (parameter -o) and directory containing preprocessed log files (parameter -d). For example: "
echo ""
echo " scripts/batch_generate_pretable.sh -d /logs_preprocessed"
echo " scripts/batch_generate_pretable.sh -d /home/user/preprocessed_dir -o /home/user/output_dir"
echo ""
}

run(){
DIR_PREPROCESSED_LOGS=$1;
DIR_OUTPUT=$2;
echo "[DIR_PREPROCESSED_LOGS] $DIR_PREPROCESSED_LOGS"

for i in `ls "$DIR_PREPROCESSED_LOGS"`; do
PPLOG=$DIR_PREPROCESSED_LOGS/$i;

echo "[Processando] $PPLOG";
gen_pt \
-f $PPLOG
gen-pretable -o $DIR_OUTPUT file -f $PPLOG;
done
}

while getopts d: opts; do
while getopts d:o: opts; do
case ${opts} in
# Diretório contendo arquivos de log preprocessados
d) DIR_PREPROCESSED_LOGS=${OPTARG} ;;
o) DIR_OUTPUT=${OPTARG} ;;
esac
done

Expand All @@ -32,5 +33,5 @@ if [[ -z "$DIR_PREPROCESSED_LOGS" ]]
help;
exit;
else
run $DIR_PREPROCESSED_LOGS;
run $DIR_PREPROCESSED_LOGS $DIR_OUTPUT;
fi
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name='scielo-usage-counter',
version='0.4.5',
version='0.4.6',
description='The SciELO Usage Counter Tool',
author='SciELO',
author_email='[email protected]',
Expand Down

0 comments on commit 75fd6cd

Please sign in to comment.