chk_fic_sap_m3_new.sh

#!/bin/sh -vx

date_fic=`date +%d%m%y`
echo « date : « $date_fic
echo «  »

nom_fic= »LPZ_SAPM3_ »$date_fic »_1.zip »
echo « nom du fichier : « $nom_fic
echo «  »
cd /exploit/scripts

HOST=’filetransfert.faiveleytransport.com’
PORT=’21’
USER=’$1′
PASSWD=’$2′

ftp -i -n $HOST $PORT << END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd lpzxm3
cd In
bin
get $nom_fic
quit
END_SCRIPT

test -s $nom_fic
fic=$?
if [ $fic -eq 0 ] ; then
${ABM_BIN}/tmail -c ${ABM_BIN}/tmail.ini -to ${1} -sub « DCC : SAP file on filetransfert.faiveleytransport.com OK » -msg  »
Dear Dietmar,

Your file $nom_fic is now on our ftp server : filetransfert.faiveleytransport.com.

Best Regards.
IT Faiveley Team »

rm $nom_fic

else
${ABM_BIN}/tmail -c ${ABM_BIN}/tmail.ini -to ${1} -cc ccosupport@faiveley-test.com -sub « ERROR : SAP file on filetransfert.faiveleytransport.com NOT OK » -msg  »
Dear Dietmar,

We have not received your file from SAP on our ftp server (filetransfert.faiveleytransport.com) or the file is empty, today.

Best Regards.
IT Faiveley Team »;
fi

exit $fic

Laisser un commentaire

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