|
|
@ -1,31 +1,10 @@ |
|
|
|
#!/bin/bash |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
#BI Update Script (Muster, siehe ../../env/BI_ENV.sam) |
|
|
|
|
|
|
|
#Benutzte Variablen: |
|
|
|
|
|
|
|
#WEBAPP=/var/lib/tomcat9/webapps/superx |
|
|
|
|
|
|
|
#Module Liste: |
|
|
|
|
|
|
|
#Hier werden die zu verwendende Module aufgelistet. |
|
|
|
|
|
|
|
#Nur den Modulnamen:ULR in Kleinbuchstaben, z.B.: |
|
|
|
|
|
|
|
#export BI_UPDATE_MODULES="sos:trans_pruefungen_1_sospos sos:trans_pruefungen_2 sos:trans_pruefungen_3 sos gang" |
|
|
|
|
|
|
|
#LOGPFAD=/var/log/tomcat9 |
|
|
|
|
|
|
|
#Mailprogramm: |
|
|
|
|
|
|
|
#export MAILPROG=s-nail |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Beispielaufruf: |
|
|
|
|
|
|
|
#export BI_UPDATE_MODULES="sos gang" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
#Variablen und Umgebung setzen: |
|
|
|
#Variablen und Umgebung setzen: |
|
|
|
|
|
|
|
|
|
|
|
MASTERLOG=$LOGPFAD/bi_update.log |
|
|
|
MASTERLOG=$LOGPFAD/bi_update.log |
|
|
|
|
|
|
|
|
|
|
|
#erzeuge Logs Verzeichnis wenn es noch nicht existiert: |
|
|
|
#erzeuge Logs Verzeichnis wenn es noch nicht existiert: |
|
|
|
mkdir -p $LOGPFAD |
|
|
|
mkdir -p $LOGPFAD |
|
|
|
|
|
|
|
|
|
|
|
echo "Start BI-Jobs $BI_UPDATE_MODULES" >$MASTERLOG |
|
|
|
|
|
|
|
date >>$MASTERLOG |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ERROR_FLAG=0 |
|
|
|
ERROR_FLAG=0 |
|
|
|
ERROR_LOG="" |
|
|
|
ERROR_LOG="" |
|
|
|
|
|
|
|
|
|
|
@ -37,48 +16,52 @@ executeUpdate() |
|
|
|
MODUL=$JOB |
|
|
|
MODUL=$JOB |
|
|
|
MODUL_UPPER=`echo $MODUL | tr [a-z] [A-Z]` |
|
|
|
MODUL_UPPER=`echo $MODUL | tr [a-z] [A-Z]` |
|
|
|
JOBLOG=$LOGPFAD/"$JOB"_update.log |
|
|
|
JOBLOG=$LOGPFAD/"$JOB"_update.log |
|
|
|
echo "Start JOB $JOB " >>$MYMASTERLOG |
|
|
|
echo "" >>$MYMASTERLOG |
|
|
|
|
|
|
|
echo "--- Start Update für: $JOB ---" >>$MYMASTERLOG |
|
|
|
date >>$MYMASTERLOG |
|
|
|
date >>$MYMASTERLOG |
|
|
|
echo java -Xmx${MEM} -cp "...CLASSPATH" -Dfile.encoding=UTF-8 de.his.edustore.modules.WebFrontendForModuleUpdate $JOB true '$SUPERX_DIR='$WEBAPP'/WEB-INF/conf/edustore $'$MODUL_UPPER'_LOAD_PFAD='$WEBAPP'/WEB-INF/conf/edustore/db/module/'$MODUL'/rohdaten $'$MODUL_UPPER'_PFAD='$WEBAPP'/WEB-INF/conf/edustore/db/module/'$MODUL >>$JOBLOG 2>&1 |
|
|
|
echo java -Xmx${MEM} -cp "...CLASSPATH" -Dfile.encoding=UTF-8 de.his.edustore.modules.WebFrontendForModuleUpdate $JOB true '$SUPERX_DIR='$WEBAPP'/WEB-INF/conf/edustore $'$MODUL_UPPER'_LOAD_PFAD='$WEBAPP'/WEB-INF/conf/edustore/db/module/'$MODUL'/rohdaten $'$MODUL_UPPER'_PFAD='$WEBAPP'/WEB-INF/conf/edustore/db/module/'$MODUL >>$JOBLOG 2>&1 |
|
|
|
java -Xmx${MEM} -cp "$QIS_CLASSPATH" -Dfile.encoding=UTF-8 de.his.edustore.modules.WebFrontendForModuleUpdate $JOB true '$SUPERX_DIR='$WEBAPP'/WEB-INF/conf/edustore $'$MODUL_UPPER'_LOAD_PFAD='$WEBAPP'/WEB-INF/conf/edustore/db/module/'$MODUL'/rohdaten $'$MODUL_UPPER'_PFAD='$WEBAPP'/WEB-INF/conf/edustore/db/module/'$MODUL >>$JOBLOG 2>&1 |
|
|
|
java -Xmx${MEM} -cp "$QIS_CLASSPATH" -Dfile.encoding=UTF-8 de.his.edustore.modules.WebFrontendForModuleUpdate $JOB true '$SUPERX_DIR='$WEBAPP'/WEB-INF/conf/edustore $'$MODUL_UPPER'_LOAD_PFAD='$WEBAPP'/WEB-INF/conf/edustore/db/module/'$MODUL'/rohdaten $'$MODUL_UPPER'_PFAD='$WEBAPP'/WEB-INF/conf/edustore/db/module/'$MODUL >>$JOBLOG 2>&1 |
|
|
|
|
|
|
|
|
|
|
|
RETURN_CODE=$? |
|
|
|
RETURN_CODE=$? |
|
|
|
echo "End Job $JOB with RETURN_CODE $RETURN_CODE" >>$MYMASTERLOG |
|
|
|
echo "Returncode von dem Job des Moduls $JOB ist: $RETURN_CODE" >>$MYMASTERLOG |
|
|
|
date >>$MYMASTERLOG |
|
|
|
date >>$MYMASTERLOG |
|
|
|
if [ $RETURN_CODE -eq 0 ] |
|
|
|
if [ $RETURN_CODE -eq 0 ] |
|
|
|
then |
|
|
|
then |
|
|
|
echo "End Job $JOB erfolgreich" >>$MYMASTERLOG |
|
|
|
echo "--- Ende Update von $JOB: erfolgreich ---" >>$MYMASTERLOG |
|
|
|
else |
|
|
|
else |
|
|
|
echo "Job $JOB Fehler" >> $MYMASTERLOG |
|
|
|
echo ">>>> Achtung: Das Update des Modules $JOB wurde mit einem Fehler beendet! <<<<" >> $MYMASTERLOG |
|
|
|
|
|
|
|
echo "--- Ende des Updates vom Modul $JOB mit Fehler ---" >>$MYMASTERLOG |
|
|
|
ERROR_FLAG=1 |
|
|
|
ERROR_FLAG=1 |
|
|
|
ERROR_LOG+=" -a $JOBLOG" |
|
|
|
ERROR_LOG+=" -a $JOBLOG" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
echo "" >>$MYMASTERLOG |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#Updates: |
|
|
|
# Schleife über Updates: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Starte BI-Jobs für die Module: $BI_UPDATE_MODULES" >$MASTERLOG |
|
|
|
|
|
|
|
date >>$MASTERLOG |
|
|
|
echo -e "######################################\n\n" >>$MASTERLOG |
|
|
|
echo -e "######################################\n\n" >>$MASTERLOG |
|
|
|
for JOB_SINGLE in ${BI_UPDATE_MODULES[@]} ; do |
|
|
|
for JOB_SINGLE in ${BI_UPDATE_MODULES[@]} ; do |
|
|
|
echo "start bi_"$JOB_SINGLE"_update `date`" >>$MASTERLOG |
|
|
|
|
|
|
|
executeUpdate $JOB_SINGLE $LOGPFAD $MASTERLOG |
|
|
|
executeUpdate $JOB_SINGLE $LOGPFAD $MASTERLOG |
|
|
|
echo "ende bi_"$JOB_SINGLE"_update `date`" >>$MASTERLOG |
|
|
|
|
|
|
|
done |
|
|
|
done |
|
|
|
echo -e "\n\n######################################" >>$MASTERLOG |
|
|
|
echo -e "\n\n######################################" >>$MASTERLOG |
|
|
|
echo -e "-- Ende BI update `date`\n\n" >>$MASTERLOG |
|
|
|
echo -e "-- Ende BI update `date`\n\n" >>$MASTERLOG |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Mailversand |
|
|
|
if [ $ERROR_FLAG -eq 0 ] |
|
|
|
if [ $ERROR_FLAG -eq 0 ] |
|
|
|
then |
|
|
|
then |
|
|
|
if [ "$MAILPROG" != "" ] |
|
|
|
if [ "$MAILPROG" != "" ] |
|
|
|
then |
|
|
|
then |
|
|
|
$MAILPROG -s "BI Job $JOB Erfolgreich" $LOGMAIL <$MYMASTERLOG |
|
|
|
$MAILPROG -s "$MAIL_BETREFF$MAIL_BETREFF_SUFFIX_ERFOLGREICH" $LOGMAIL <$MYMASTERLOG |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
if [ "$MAILPROG" != "" ] |
|
|
|
if [ "$MAILPROG" != "" ] |
|
|
|
then |
|
|
|
then |
|
|
|
echo "sending logmail to $LOGMAIL" |
|
|
|
echo "Sende Logmail an $LOGMAIL" |
|
|
|
$MAILPROG -s "BI Job $JOB Fehler" $ERROR_LOG $LOGMAIL <$MYMASTERLOG |
|
|
|
$MAILPROG -s "$MAIL_BETREFF$MAIL_BETREFF_SUFFIX_FEHLER" $ERROR_LOG $LOGMAIL <$MYMASTERLOG |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
fi |
|
|
|
fi |
|
|
|