diff --git a/Utils/Dataflow/run/data4es-consistency-check b/Utils/Dataflow/run/data4es-consistency-check new file mode 100755 index 000000000..da8b8f524 --- /dev/null +++ b/Utils/Dataflow/run/data4es-consistency-check @@ -0,0 +1,37 @@ +#!/bin/bash -l + +DEBUG= + +base_dir=$( cd "$(dirname "$(readlink -f "$0")")"; pwd) + +# Directories with configuration files +[ -n "$DATA4ES_CONSISTENCY_CONFIG_PATH" ] && \ + CONFIG_PATH="$DATA4ES_CONSISTENCY_CONFIG_PATH" || \ + CONFIG_PATH="${base_dir}/../config:${base_dir}/../../Elasticsearch/config" + +# Find configuration file in $CONFIG_PATH +get_config() { + [ -z "$1" ] && echo "get_config(): no arguments passed." && return 1 + dirs=$CONFIG_PATH + while [ -n "$dirs" ]; do + dir=${dirs%%:*} + [ "$dirs" = "$dir" ] && \ + dirs='' || \ + dirs="${dirs#*:}" + [ -f "${dir}/${1}" ] && readlink -f "${dir}/${1}" && return 0 + done +} + +# Oracle +cfg009=`get_config "consistency009.cfg"` +cmd_009="$base_dir/../009_oracleConnector/Oracle2JSON.py --config $cfg009" + +# ES +cfg_es=`get_config "es"` +cmd_069="$base_dir/../069_upload2es/consistency.py -m s --conf $cfg_es" + +[ -n "$DEBUG" ] && + err009="009.err" || + err009=/dev/null + +$cmd_009 2>"$err009" | $cmd_069