mmt sql
This commit is contained in:
28
scripts/con_check.sh
Executable file
28
scripts/con_check.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
#HOME="/home/compegence/customer"
|
||||
#Directories
|
||||
fileDir="/data/customer/MMT"
|
||||
homeDir=$HOME/customer/MMT
|
||||
configDir=$homeDir/conf
|
||||
input_file=$configDir/etl-config.txt
|
||||
declare -A credentials
|
||||
while IFS="=" read -r key value; do
|
||||
credentials[$key]=$value
|
||||
done < <( sed -e '/^\s*$/ d' -e '/^#/ d' $input_file )
|
||||
#for i in ${credentials[@]}; do echo ***$i; done
|
||||
|
||||
user=${credentials[user]}
|
||||
password=${credentials[password]}
|
||||
host=${credentials[host]}
|
||||
db=${credentials[db]}
|
||||
protocol=${credentials[protocol]}
|
||||
server=${credentials[server]}
|
||||
|
||||
postgres_con="psql -A -t postgresql://$user:$password@$host/$db"
|
||||
|
||||
|
||||
count=`$postgres_con -c "select count(*) from staging1.temtable"`
|
||||
|
||||
echo $count
|
||||
|
||||
Reference in New Issue
Block a user