Skip to content

Commit

Permalink
Add a very basic consistency check script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evildoor committed Apr 3, 2019
1 parent 4c560a6 commit 2296f6d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Utils/Dataflow/run/data4es-consistency-check
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2296f6d

Please sign in to comment.