#!/bin/sh # Parametre 1 : environnement sur lequel seront chargees les donnees # Parametre 2 : nom du fichier utilise pour l'initialisation du refentiel ou "integration" pour le mode normal (apres une initialisation. # exemple de nom de fichier : LPZ_SAPM3_210510_1.zip (le fichier doit se trouver dans le repertoire : ftp.faiveley.com/LpzXM3/input)
echo "Environnement : "${1} echo "Mode d'execution : "${2} echo ""
# Sauvegarde des fichiers avant traitement dt_dir=`date +"%Y_%m_%d_%H%M%S"` dir_save=sauve_av_traitement_$dt_dir cd /data/talend/repository/${1} mkdir $dir_save cp *.* $dir_save
sleep 5
sh /data/talend/jobs/LPZ_SAP_M3_INTEGRATION_1.2/LPZ_SAP_M3_INTEGRATION/LPZ_SAP_M3_INTEGRATION_run.sh ${1} ${2}
err_sh=$?
echo "Valeur err_sh : "$err_sh
echo "" dt_fin=`date +"%A %d/%m/%Y - %H:%M:%S"` echo $dt_fin echo ""
if [ $err_sh -eq 0 ] ; then ${ABM_BIN}/tmail -c ${ABM_BIN}/tmail.ini -to ${3} -sub "DCC : Integration SAP - M3 env: ${1} - OK" -msg " ----------------------------- VTOM MESSAGE OK ---------------------------------------
The scheduler Vtom has successfully completed the process of Talend integration of SAP-LPZ data in M3 (${1}).
Please verify log file you received from Talend for any functional failure.
Best Regards.
------------------------------ END OF VTOM MESSAGE -----------------------------------------" -att $TOM_LOG.o\;$TOM_LOG.e else ${ABM_BIN}/tmail -c ${ABM_BIN}/tmail.ini -to ${3} -cc ${4} -sub "ERROR - Integration SAP - M3 env: ${1} - ERROR" -msg " ******************* VTOM MESSAGE ERROR ***********************
The scheduler Vtom has completed with error the process of Talend integration of SAP-LPZ data in M3 (${1}).
Please verify log file you received from Talend for any functional failure.
Best Regards.
******************* END OF VTOM MESSAGE ERROR***********************" -att $TOM_LOG.o\;$TOM_LOG.e err_sh=1 fi exit $err_sh