From 940570c18c867969228670eb7a357a16e155a3ac Mon Sep 17 00:00:00 2001 From: Emilien Devos <121870973+edevosc2c@users.noreply.github.com> Date: Fri, 16 Feb 2024 11:54:47 +0100 Subject: [PATCH] Revert "feat: vrt log in file" This reverts commit d95b9940068494c44c05e245d2f57285289e78ef. Changes are not suitable. See review of PR. --- vrt.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/vrt.sh b/vrt.sh index 99ec377..2560179 100755 --- a/vrt.sh +++ b/vrt.sh @@ -24,8 +24,7 @@ set -e # horodatage pour commentaires DATE=$(date "+%A %d/%m/%Y %H:%M:%S") -rm -f ${SOURCEDIR}/vrtbot.log -touch ${SOURCEDIR}/vrtbot.log + if [ -n "$(ls -A $SOURCEDIR 2>/dev/null)" ] then @@ -34,21 +33,21 @@ touch ${SOURCEDIR}/vrtbot.log # cycle vrt for vrt in *.vrt; do - echo "import de ${SOURCEDIR}/${vrt} dans le schema ${ACTIVESCHEMA} de la base ${PGDATABASE}" | tee -a vrtbot.log + echo "import de ${SOURCEDIR}/${vrt} dans le schema ${ACTIVESCHEMA} de la base ${PGDATABASE}" /usr/bin/ogr2ogr \ -f Postgresql \ -overwrite \ - PG:"active_schema=${ACTIVESCHEMA}" "${vrt}" -lco SCHEMA=${ACTIVESCHEMA} -lco OVERWRITE=yes -lco GEOMETRY_NAME=geometry -nlt PROMOTE_TO_MULTI -lco DESCRIPTION="import par ${JOB_NAME}/${BUILD_NUMBER} le ${DATE} - ${SOURCEDIR}/${vrt}" 2>&1 | tee -a vrtbot.log + PG:"active_schema=${ACTIVESCHEMA}" "${vrt}" -lco SCHEMA=${ACTIVESCHEMA} -lco OVERWRITE=yes -lco GEOMETRY_NAME=geometry -nlt PROMOTE_TO_MULTI -lco DESCRIPTION="import par ${JOB_NAME}/${BUILD_NUMBER} le ${DATE} - ${SOURCEDIR}/${vrt}" # post import sql if [ -f "${vrt}.sql" ]; then - echo "script sql après import trouvé" | tee -a vrtbot.log + echo "script sql après import trouvé" source "settings" - psql -f "${vrt}.sql" | tee -a vrtbot.log - echo "script sql après import exécuté" | tee -a vrtbot.log + psql -f "${vrt}.sql" + echo "script sql après import exécuté" fi done else - echo "${SOURCEDIR} n'existe pas" | tee -a vrtbot.log + echo "${SOURCEDIR} n'existe pas" fi