-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_db.sh
executable file
·38 lines (24 loc) · 1.25 KB
/
install_db.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
GN_PATH="$1"
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
. $GN_PATH/config/settings.ini
LOG_FILE="$GN_PATH/var/log/install_monitoring_oedic.log"
echo Create schema_oedic.sql
echo "Create oedic schema..." > $LOG_FILE
echo "--------------------" &>> $LOG_FILE
echo "" &>> $LOG_FILE
# export PGPASSWORD=$user_pg_pass;psql -h $db_host -U $user_pg -d $db_name -f $SCRIPTPATH/data/schema_oedic.sql &>> $LOG_FILE
export PGPASSWORD=$user_pg_pass;psql -h $db_host -U $user_pg -d $db_name -f $SCRIPTPATH/data/schema_oedic.sql
echo Import data
echo "Import oedic data" &>> $LOG_FILE
echo "--------------------" &>> $LOG_FILE
echo "" &>> $LOG_FILE
# export PGPASSWORD=$user_pg_pass;psql -h $db_host -U $user_pg -d $db_name -f $SCRIPTPATH/data/data_oedic.sql &>> $LOG_FILE
export PGPASSWORD=$user_pg_pass;psql -h $db_host -U $user_pg -d $db_name -f $SCRIPTPATH/data/data_oedic.sql
echo Import data site
echo create views
echo "Create oedic views" &>> $LOG_FILE
echo "--------------------" &>> $LOG_FILE
echo "" &>> $LOG_FILE
# export PGPASSWORD=$user_pg_pass;psql -h $db_host -U $user_pg -d $db_name -f $SCRIPTPATH/data/views_oedic.sql &>> $LOG_FILE
export PGPASSWORD=$user_pg_pass;psql -h $db_host -U $user_pg -d $db_name -f $SCRIPTPATH/data/views_oedic.sql