e-Commerce Gateway Inbound need the Profile Option ‘Sequential Numbering’ needs to be set
at the application and responsibility level to be able to generate order numbers in Order Management"
Friday, September 11, 2015
Thursday, September 3, 2015
Check FTP/SFTP status in Shell script
Status of FTP / SFTP can be check with below code in the shell script
2>&1 -- This is going to redirect stderr to stdout
user $USER $PASSWD
put file.txt
bye
EOF`
ctr=`echo "$result" | grep "226 Transfer complete" | wc -l`
#for error check, check the return string as it's different for FTP and SFTP
err_ctr=`echo "$result" | grep "Couldn't read packet" | wc -l`
if [ $ctr -gt 0 ]
then
echo "File Transfer successful"
elif [ $err_ctr -gt 0 ]
then
echo "connection failure"
fi
2>&1 -- This is going to redirect stderr to stdout
result=`ftp -nv 111.111.111.111 << EOF 2>&1user $USER $PASSWD
put file.txt
bye
EOF`
ctr=`echo "$result" | grep "226 Transfer complete" | wc -l`
#for error check, check the return string as it's different for FTP and SFTP
err_ctr=`echo "$result" | grep "Couldn't read packet" | wc -l`
if [ $ctr -gt 0 ]
then
echo "File Transfer successful"
elif [ $err_ctr -gt 0 ]
then
echo "connection failure"
fi
Subscribe to:
Posts (Atom)