You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.8 KiB
65 lines
1.8 KiB
#!/bin/bash |
|
|
|
#Arbeitsverzeichnis fuer crontab |
|
PFAD=$2 |
|
if [ "$PFAD" != "" ] |
|
then |
|
|
|
cd $PFAD |
|
|
|
fi |
|
#Umgebung einlesen: |
|
if [ "$PROMSTAT_PFAD" = "" ] |
|
then |
|
echo "ACHTUNG: Die Umgebungsvariable PROMSTAT_PFAD ist nicht gesetzt. Bitte prüfen Sie $SUPERX_DIR/db/bin/SQL_ENV" |
|
|
|
exit 1 |
|
|
|
fi |
|
if [ "$PROMSTAT_ERRORMAIL" != "" ] |
|
then |
|
ERRORMAIL=$PROMSTAT_ERRORMAIL |
|
export ERRORMAIL |
|
fi |
|
if [ "$PROMSTAT_LOGMAIL" != "" ] |
|
then |
|
LOGMAIL=$PROMSTAT_LOGMAIL |
|
export LOGMAIL |
|
fi |
|
if [ "$PROMSTAT_BACKUP" != "" ] |
|
then |
|
MODULE_BACKUP=$PROMSTAT_BACKUP |
|
export MODULE_BACKUP |
|
fi |
|
|
|
#hier geht es los |
|
#runAndCheck.x path command (EXIT_ON_ERROR|CONT_ON_ERROR) (SEND_ERRORMAIL|NO_ERRORMAIL) (SEND_LOGMAIL|NO_LOGMAIL) [description] " |
|
echo "promstat-Update startet" >$PROMSTAT_ERRORDAT |
|
#Tagesdatum für Systeminfo |
|
date +'%d.%m.%Y' > $PROMSTAT_LOAD_PFAD/superx.datum |
|
|
|
runAndCheck.x $PROMSTAT_PFAD "module_etl.x promstat $PROMSTAT_PFAD $PROMSTAT_LOAD_PFAD" EXIT_ON_ERROR SEND_ERRORMAIL SEND_LOGMAIL "PROMSTAT update$MANDANTID" |
|
cat $PROMSTAT_PFAD/L_PROMSTAT_update$MANDANTID.log >>$PROMSTAT_ERRORDAT |
|
|
|
|
|
fgrep -s "not found" $PROMSTAT_ERRORDAT |
|
FLAG1=$? |
|
fgrep -i -s "error" $PROMSTAT_ERRORDAT |
|
FLAG2=$? |
|
fgrep -i -s "nicht gefunden" $PROMSTAT_ERRORDAT |
|
FLAG3=$? |
|
if [ $FLAG1 -eq 0 -o $FLAG2 -eq 0 -o $FLAG3 -eq 0 ] |
|
then |
|
echo "Fehler beim PROMSTAT-Update " |
|
echo "---------------------------------------" |
|
echo "Fehlerprotokoll in $PROMSTAT_ERRORDAT" |
|
echo "---------------------------------------" |
|
cp $PROMSTAT_LOAD_PFAD/superx.datum.alt $PROMSTAT_LOAD_PFAD/superx.datum |
|
else |
|
echo "PROMSTAT-Update erfolgreich" |
|
fi |
|
|
|
echo "---------------------------Beginn Prüfroutine-----------------------------------" >>$PROMSTAT_ERRORDAT |
|
#cat $PROMSTAT_PFAD/L_promstat_Test$MANDANTID.log >>$PROMSTAT_ERRORDAT |
|
pruefmail.x $PROMSTAT_PFAD/L_promstat_Test$MANDANTID.log $ERRORMAIL |
|
|
|
|