Daniel Quathamer
2 years ago
6 changed files with 150 additions and 28 deletions
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash |
||||
|
||||
#Arbeitsverzeichnis fuer crontab |
||||
PFAD=$2 |
||||
if [ "$PFAD" != "" ] |
||||
then |
||||
|
||||
cd $PFAD |
||||
|
||||
fi |
||||
#Umgebung einlesen: |
||||
if [ "$COSTAGE_PFAD" = "" ] |
||||
then |
||||
echo "ACHTUNG: Die Umgebungsvariable COSTAGE_PFAD ist nicht gesetzt. Bitte prüfen Sie $SUPERX_DIR/db/bin/SQL_ENV" |
||||
|
||||
exit 1 |
||||
|
||||
fi |
||||
if [ "$COSTAGE_ERRORMAIL" != "" ] |
||||
then |
||||
ERRORMAIL=$COSTAGE_ERRORMAIL |
||||
export ERRORMAIL |
||||
fi |
||||
if [ "$COSTAGE_LOGMAIL" != "" ] |
||||
then |
||||
LOGMAIL=$COSTAGE_LOGMAIL |
||||
export LOGMAIL |
||||
fi |
||||
if [ "$COSTAGE_BACKUP" != "" ] |
||||
then |
||||
MODULE_BACKUP=$COSTAGE_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 "costage-Update startet" >$COSTAGE_ERRORDAT |
||||
|
||||
runAndCheck.x $COSTAGE_PFAD "module_etl.x costage $COSTAGE_PFAD $COSTAGE_LOAD_PFAD" EXIT_ON_ERROR SEND_ERRORMAIL SEND_LOGMAIL "COSTAGE update$MANDANTID" |
||||
|
||||
echo "---------------------------Beginn Prüfroutine-----------------------------------" >>$COSTAGE_ERRORDAT |
||||
cat $COSTAGE_PFAD/L_COSTAGE_update$MANDANTID.log >>$COSTAGE_ERRORDAT |
||||
|
||||
pruefmail.x $COSTAGE_PFAD/L_costage_Test$MANDANTID.log $ERRORMAIL |
||||
|
||||
|
||||
#Bei Fehlern Datum zurücksetzen: |
||||
fgrep -s "not found" $COSTAGE_ERRORDAT |
||||
FLAG1=$? |
||||
fgrep -i -s "error" $COSTAGE_ERRORDAT |
||||
FLAG2=$? |
||||
fgrep -i -s "nicht gefunden" $COSTAGE_ERRORDAT |
||||
FLAG3=$? |
||||
fgrep -i -s "fehler" $COSTAGE_ERRORDAT |
||||
FLAG4=$? |
||||
|
||||
if [ $FLAG1 -eq 0 -o $FLAG2 -eq 0 -o $FLAG3 -eq 0 -o $FLAG4 -eq 0 ] |
||||
then |
||||
echo "Fehler beim COSTAGE-Update " |
||||
echo "---------------------------------------" |
||||
echo "Fehlerprotokoll in $COSTAGE_ERRORDAT" |
||||
echo "Das Datum wird zurückgesetzt. Kopieren Sie die Datei superx.datum ggf. auf den COSTAGE-Rechner" |
||||
echo "---------------------------------------" |
||||
cp $COSTAGE_LOAD_PFAD/superx.datum.alt $COSTAGE_LOAD_PFAD/superx.datum |
||||
else |
||||
echo "COSTAGE-Update erfolgreich" |
||||
fi |
||||
|
Loading…
Reference in new issue