comparison flys-backend/contrib/import_river.sh @ 5355:480d2f1f61cc

Fix import_rivers script for postgres
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 20 Mar 2013 19:02:10 +0100
parents 14186e924534
children 7c646d4d5103
comparison
equal deleted inserted replaced
5354:555a99dff849 5355:480d2f1f61cc
76 EOF 76 EOF
77 exit 0 77 exit 0
78 } 78 }
79 79
80 OPTS=`getopt -o ?u:w:h:p:d: \ 80 OPTS=`getopt -o ?u:w:h:p:d: \
81 -l help,username:,password:,host:,port:,db-name:,skip-hydro,skip-morpho,skip-geo,skip-wst \ 81 -l help,username:,password:,host:,port:,db-name:,skip-hydro,skip-morpho,skip-geo,skip-wst,postgres \
82 -n $0 -- "$@"` 82 -n $0 -- "$@"`
83 if [ $? != 0 ] ; then usage; fi 83 if [ $? != 0 ] ; then usage; fi
84 eval set -- "$OPTS" 84 eval set -- "$OPTS"
85 while true ; do 85 while true ; do
86 case "$1" in 86 case "$1" in
159 RIVER_NAME=$(grep "Gew.sser" "$1" | awk '{print $2}') 159 RIVER_NAME=$(grep "Gew.sser" "$1" | awk '{print $2}')
160 DATE=$(date +%Y.%m.%d_%H%M) 160 DATE=$(date +%Y.%m.%d_%H%M)
161 LOG_DIR=${LOG}/${RIVER_NAME}-$DATE 161 LOG_DIR=${LOG}/${RIVER_NAME}-$DATE
162 mkdir -p ${LOG_DIR} 162 mkdir -p ${LOG_DIR}
163 163
164 if [ "POSTGRES" = "TRUE" ]; then 164 if [ "$POSTGRES" = "TRUE" ]; then
165 JAR=$(echo "$JAR" | sed 's/importer/importer_psql/') 165 JAR=$(echo "$JAR" | sed 's/importer/importer_psql/')
166 if [ ! -r "$JAR" ]; then 166 if [ ! -r "$JAR" ]; then
167 echo "Could not find Postgres importer $JAR" 167 echo "Could not find Postgres importer $JAR"
168 exit 1 168 exit 1
169 fi 169 fi

http://dive4elements.wald.intevation.org