cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ftp script

Former Member
0 Kudos

Hi experts,

I am getting a problem, i am using receiver file adapter with NFS(transfer protocal),

the file is coming to file system. from file system i am trying to put file into ftp server.

i wrote a bat file in that i gave all details (like connect to ftp server,user name, passward, put file from file system to ftp server) of ftp server, i am giving this bat file as commandline attribute in receiver communication channel

the problem is xi executing the bat file, but it is always showing sucess in adapter engine monitering irrespective of wheter file is put in ftp server or not. can anyone help?

thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Ravi,

We cannot the handle the errors on the FTP side in XI. So first what you do is first execute the batch job at OS level manually. Be in the XI root directory and run the script. If it is successfully completed then XI will definitely run the script and give the output. If it runs at OS level and not at XI level then there is a problem with the authorizations. So better have the same authorizations and run the scenario once again.

-


Satish

Former Member
0 Kudos

Ravi,

It always happens like that. XI shows that as success if it runs the batch file. But if some statements in batch file fails, there is no way XI would know this. because there is no mechanism there to tell that particular batch file is failed. So, it just runs the command and says its success. It doesnt mean that whatever you are doign in the bacth file is success.

Earlier I worked in webMethods EAI tool, there also we have option for commandLine to execute the batch or shell scripts. Even webMethods shows success always just like XI for running that batch file. Its the standard functionality all middleware has.

--Archana

0 Kudos

Hi,

if you want to monitor a ftp transfer via XI use FTP and not NFS. can you please post the bat file? i think there is the problem.

XI is showing sucess, because the bat file is executed. a work around:

- specify a time out in the adapter for the comand

- if the transfer didn't worked, cause a time out in the script (i.e.: PING 127.0.0.1 -n 100)

But i would recommend to use the ftp file adapter. Whats the reason to do it this way?

Regards

J.

Former Member
0 Kudos

Hi this is the bat file

xxx.bat

ftp -s://xxxx.txt

xxxx.txt

open ftptest.com

username

passward

put xyz.txt

bye

we tried with FTP protocal

it dint sucess, so thats why we have chosen this way.

Former Member
0 Kudos

Ravi,

as I said, there is no way, the batch file can communicate the result back to XI. so, whatever status XI shows doesnt reflect that your batch file has executed all the steps in it successfully.

--Archana

Former Member
0 Kudos

Is there any other way to handle this? because i need to do this.

0 Kudos

in sp 16 (or above) the fixed a lot of problems with passiv / active ftp conections. what was exactly the problem with the ftp? do you use a ftp proxy?

Regards

J.

Former Member
0 Kudos

let me understand..why do u need batch file at all?

Is it not a simple File to File scenario with NFS on one side and FTP on other side? Am I missing anything here? why do you need batch file?

I can give you some suggestion once i get the clear picture of what you are trying to do.

--Archana

Former Member
0 Kudos

it is fle to file scenario with bpm, in the bpm it uses jdbc adapter to get data from jdbc and put it that as file in other side, when we use ftp both sides we got problem in receiver side, so we switched to NFS in receiving side, but our goal is to put file on the ftp server, so thats why we used bat file to put file on ftp server

Former Member
0 Kudos

so when you get back the data from jdbc and put that in file..you are using file receiver here right? so, receiver communication channel you can specify FTP as protocol right. so why do u need to ftp again separately.

Former Member
0 Kudos

we got a problem when we use ftp, so thats why we swichted to NFS

--Ravi

Former Member
0 Kudos

if ftp is not working, then the better option would be writing scheduling a job at operating system level and executing the batch job. commandLine option in XI doesnt always give you the right status.

--Archana

Former Member
0 Kudos

Can you tell me in detail that how to do that?

Former Member
0 Kudos

In windows --- you can use 'schtasks' option to sechedule jobs at whatever time you want which runs your batch file

In Unix -- write a shell script or create a cron job for scheduling

Former Member
0 Kudos

then at that time also, how xi come to know that the file is put or not.

actually we are doing reverse testing, if script unable to put file, then we need to come to know trough XI or by any alert, as XI can not come to know about failure how can we raise an alert?

Former Member
0 Kudos

XI doesnt know. Now they are completely separate processes.

Former Member
0 Kudos

Can we send a mail using a script file? if so we can solve this problem by sending a mail to sender when script fail to put file on ftp.

Can any one tell me how to send a mail using a script(OS level)?

Former Member
0 Kudos

go through this link. it talks about sending email from shell script.

http://www.shelldorado.com/articles/mailattachments.html

Former Member
0 Kudos

I want to send mail from windows using script

Former Member
0 Kudos

look in google. search for "sending email from batch file", I could see few options. But u guys need to decide which way to go.