Mercurial > dive4elements > river
comparison flys-backend/contrib/import_river.sh @ 5459:7c646d4d5103
be more flexible with river names (e.g. containing white space) in import script
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 27 Mar 2013 15:26:51 +0100 |
parents | 480d2f1f61cc |
children | 673f68bb19a4 |
comparison
equal
deleted
inserted
replaced
5458:e667c127b600 | 5459:7c646d4d5103 |
---|---|
154 if [ ! -r $1 ]; then | 154 if [ ! -r $1 ]; then |
155 echo "Could not open $1 please ensure it exists and is readable" | 155 echo "Could not open $1 please ensure it exists and is readable" |
156 fi | 156 fi |
157 | 157 |
158 GEW_FILE="$1" | 158 GEW_FILE="$1" |
159 RIVER_NAME=$(grep "Gew.sser" "$1" | awk '{print $2}') | 159 RIVER_NAME=$(grep "Gew.sser" "$1" | sed 's/Gew.sser: //') |
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}/`basename $GEW_FILE .gew`-$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 |