Envoi de mail suite erreur job Vtom.

Windows

set retcode=%ERRORLEVEL%

echo ------------------ Fin Talend -----------------------
echo retcode : %retcode%

if %retcode%==0 goto :FIN

:ERREUR
L:
copy /Y %TOM_LOG_PATH_E% %TOM_LOG_PATH_E%.txt 2>nul
copy /Y %TOM_LOG_PATH_O% %TOM_LOG_PATH_O%.txt 2>nul

echo envoi de mail suite erreur job
%ABM_BIN%/tmail -c %ABM_BIN%/tmail.ini -to %w_dest% -cc %w_cc% -sub "VTOM : ERROR : %TOM_ENVIRONMENT% / %TOM_APPLICATION% / %TOM_JOB% job failed" -msg "ERROR : Job %TOM_JOB% Code retour (%retcode%) en erreur " -att %TOM_LOG_PATH_E%.txt;%TOM_LOG_PATH_O%.txt

:FIN
exit /B %retcode%

====================================================

Linux

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
echo Job completed : OK
else
${ABM_BIN}/tmail -c ${ABM_BIN}/tmail.ini -to ${1} -cc ${2} -sub "ERROR :$TOM_JOB - ERROR" -msg "
******************* VTOM MESSAGE ERROR ***********************

The scheduler Vtom has completed with error.

Error code : $err_sh

Please verify log file joint.

Best Regards.

******************* END OF VTOM MESSAGE ERROR***********************" -att $TOM_LOG.o\;$TOM_LOG.e
fi
exit $err_sh

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *