Skip to content

Commit

Permalink
Merge #1933 from branch '1847-adjustLogPathsInCheckingScripts' of htt…
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Oct 27, 2023
2 parents 93c4d09 + 26daf82 commit 1243053
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions web/scripts/getLogsErrorsETL.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# author: dr0i
#
# grep all MapperParsingException in ETL.log and send email
# grep all MapperParsingException in etl.log and send email
# see https://github.com/hbz/lobid-resources/issues/1512

MAIL_TO=$(cat .secrets/MAIL_TO)
Expand All @@ -9,9 +9,9 @@ MAIL_FROM=$(cat .secrets/MAIL_FROM)
ERROR_PATTERN="MapperParsingException"

if [ -z $1 ]; then
NEWEST_LOG_FN="../logs/application.log"
NEWEST_LOG_FN="../logs/etl.log"
else
NEWEST_LOG_FN=$(ls ../application-log*.gz| tail -n1)
NEWEST_LOG_FN=$(ls ../etl-log*.gz| tail -n1)
fi


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
MAIL_TO=$(cat .secrets/MAIL_TO)
MAIL_FROM=$(cat .secrets/MAIL_FROM)
if [ -z $1 ]; then
NEWEST_LOG_FN=$(ls ../application-log*.gz| tail -n1)
NEWEST_LOG_FN=$(ls ../etl-log*.gz| tail -n1)
else
NEWEST_LOG_FN="../logs/application.log"
NEWEST_LOG_FN="../logs/etl.log"
fi
echo $NEWEST_LOG_FN
ERRORS=$(zgrep -v 'replace_all("hbzId",' $NEWEST_LOG_FN | grep -B1 'Error while executing Fix expression')
Expand All @@ -21,7 +21,7 @@ if [ -n "$ERRORS" ]; then
fi
echo "$SHORTEND_ERRORS"
mail -s "FIX errors in Alma Fix ETL" "${MAIL_TO}" -a "From: ${MAIL_FROM}" << EOF
Getriggert von ausgeführt in $(pwd)/scripts/getLogsApplicationFixErrors.sh :
Getriggert von ausgeführt in $(pwd)/scripts/getLogsEtlFixErrors.sh :
Achte auf das Datum der ERROR-Zeilen - evtl. sind das alte Fehler!
Expand Down
2 changes: 1 addition & 1 deletion web/scripts/getMultipleHbzid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAIL_FROM=$(cat .secrets/MAIL_FROM)
SEND_TO_VERBUND=$(cat .secrets/SEND_TO_VERBUND)

cd ../
NEWEST_LOG_FN=$(ls application-log*.gz| tail -n1)
NEWEST_LOG_FN=$(ls etl-log*.gz| tail -n1)
echo $NEWEST_LOG_FN
HBZIDS=$( zgrep -B2 'java.lang.IllegalStateException: Expected String, got Array' $NEWEST_LOG_FN |grep -B1 'replace_all("hbzId",'| grep hbzId= | sed "s#\(.*\)almaMmsId=\(.*\), id=.*hbzId\(.*\)#\2\3#g" |tr = , |sed "s#\[\(.*\)\].*#\1#g"|sort -u)
echo "$HBZIDS" >> $NEWEST_LOG_FN
Expand Down
2 changes: 1 addition & 1 deletion web/scripts/getWebhookCallerLogs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MAIL_FROM=$(cat .secrets/MAIL_FROM)

ERROR_PATTERN="Got response code\|HttpPoster\|notifyWebhook"

NEWEST_LOG_FN="../logs/ETL.log"
NEWEST_LOG_FN="../logs/etl.log"
ERRORS=$(grep -B1 "$ERROR_PATTERN" $NEWEST_LOG_FN)
DATE=$(date +"%F")
ERRORS=$(echo "$ERRORS" | grep $DATE| grep "ERROR\|response code"|grep -v 204)
Expand Down

0 comments on commit 1243053

Please sign in to comment.