Commit 3361c597 authored by Bergamote Orange's avatar Bergamote Orange
Browse files

clea-batch.sh script file update with safeguards on log file

parent 2f30bd88
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<appender-ref ref="RollingFile" /> <appender-ref ref="RollingFile" />
</logger> </logger>
<!-- at TRACE level --> <!-- at ERROR level -->
<logger name="error" level="error" additivity="false"> <logger name="error" level="error" additivity="false">
<appender-ref ref="RollingErrorFile" /> <appender-ref ref="RollingErrorFile" />
</logger> </logger>
......
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
PROGNAM=$(basename $0) PROGNAM=$(basename $0)
die() { echo "[$PROGNAM] $*" 1>&2 ; exit 1; } die() { echo "[$PROGNAM] $*" 1>&2 ; exit 1; }
# redirect logs to log file
test -f "${CLEA_BATCH_LOG_FILE_PATH}/${CLEA_BATCH_LOG_FILE_NAME}.log" || die "log file: ${CLEA_BATCH_LOG_FILE_PATH}/${CLEA_BATCH_LOG_FILE_NAME}.log does not exist"
test -f "${CLEA_BATCH_LOG_FILE_PATH}/${CLEA_BATCH_LOG_FILE_NAME}.error.log" || die "error log file: ${CLEA_BATCH_LOG_FILE_PATH}/${CLEA_BATCH_LOG_FILE_NAME}.error.log does not exist"
exec >> "${CLEA_BATCH_LOG_FILE_PATH}/${CLEA_BATCH_LOG_FILE_NAME}.log"
exec 2>> "${CLEA_BATCH_LOG_FILE_PATH}/${CLEA_BATCH_LOG_FILE_NAME}.error.log"
WORKDIR=${CLEA_BATCH_CLUSTER_OUTPUT_PATH:-/tmp/v1} WORKDIR=${CLEA_BATCH_CLUSTER_OUTPUT_PATH:-/tmp/v1}
BUCKET=${BUCKET:-} BUCKET=${BUCKET:-}
...@@ -20,7 +27,7 @@ if ! java -jar clea-batch.jar $@ ; then ...@@ -20,7 +27,7 @@ if ! java -jar clea-batch.jar $@ ; then
fi fi
echo "[$PROGNAM] Coying files...." echo "[$PROGNAM] Copying files...."
# Test that output folder exists, computing NBFILES fails if folder doesn't exist # Test that output folder exists, computing NBFILES fails if folder doesn't exist
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<appender-ref ref="RollingFile" /> <appender-ref ref="RollingFile" />
</logger> </logger>
<!-- at TRACE level --> <!-- at ERROR level -->
<logger name="error" level="error" additivity="false"> <logger name="error" level="error" additivity="false">
<appender-ref ref="RollingErrorFile" /> <appender-ref ref="RollingErrorFile" />
</logger> </logger>
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<appender-ref ref="RollingFile" /> <appender-ref ref="RollingFile" />
</logger> </logger>
<!-- at TRACE level --> <!-- at ERROR level -->
<logger name="error" level="error" additivity="false"> <logger name="error" level="error" additivity="false">
<appender-ref ref="RollingErrorFile" /> <appender-ref ref="RollingErrorFile" />
</logger> </logger>
......
...@@ -6,8 +6,8 @@ services: ...@@ -6,8 +6,8 @@ services:
build: ../clea-ws-rest/ build: ../clea-ws-rest/
environment: environment:
SPRING_PROFILES_ACTIVE: dev,docker SPRING_PROFILES_ACTIVE: dev,docker
CLEA_WS_REST_LOG_FILE_PATH: -/logs CLEA_WS_REST_LOG_FILE_PATH: /logs
CLEA_WS_REST_LOG_FILE_NAME: -clea-ws-rest CLEA_WS_REST_LOG_FILE_NAME: clea-ws-rest
depends_on: depends_on:
- kafka - kafka
ports: ports:
...@@ -22,8 +22,8 @@ services: ...@@ -22,8 +22,8 @@ services:
environment: environment:
SPRING_PROFILES_ACTIVE: dev,docker SPRING_PROFILES_ACTIVE: dev,docker
SPRING_JPA_HIBERNATE_DDL_AUTO: none SPRING_JPA_HIBERNATE_DDL_AUTO: none
CLEA_VENUE_CONSUMER_LOG_FILE_PATH: -/logs CLEA_VENUE_CONSUMER_LOG_FILE_PATH: /logs
CLEA_VENUE_CONSUMER_LOG_FILE_NAME: -clea-venue-consumer CLEA_VENUE_CONSUMER_LOG_FILE_NAME: clea-venue-consumer
depends_on: depends_on:
- postgres - postgres
- kafka - kafka
...@@ -39,8 +39,8 @@ services: ...@@ -39,8 +39,8 @@ services:
environment: environment:
SPRING_PROFILES_ACTIVE: docker SPRING_PROFILES_ACTIVE: docker
BUCKET: clea-batch BUCKET: clea-batch
CLEA_BATCH_LOG_FILE_PATH: -/logs CLEA_BATCH_LOG_FILE_PATH: /logs
CLEA_BATCHLOG_FILE_NAME: -clea-batch CLEA_BATCH_LOG_FILE_NAME: clea-batch
ports: ports:
- "15000:15000" - "15000:15000"
depends_on: depends_on:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment