cancel
Showing results for 
Search instead for 
Did you mean: 

Remoter Server FTPing

Former Member
0 Kudos

I need to run a Batch file, in my Receiver File Adapter to do an FTP Processing

XI Receiver File Adapter

-


Run Operating System Command After MEssage Processing

Command Line :C:\SALES\FTP.BAT

FTP.BAT

-


ftp -s:parameters.ini FTP.SERVER > logfile.txt

I am trying to search the above logfile in my XI server, but I am lost. Would some one guide me where exactly I have to search in XI?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey

>>I need to run a Batch file, in my Receiver File Adapter to do an FTP Processing

is your requirement just to connect to the FTP server?if yes,then you dont need any OS level scripts as you have,just give the FTP parameters in the receiver file adapter

what exactly are you trying to do with logfile.txt?can you please explain a little bit

Thanx

Ahmad

Former Member
0 Kudos

Thanks Ahamad. My requirement is I need to FTP a Sales File to a remote FTP Server,

The FTP server has been built in sucha way that , I need to use the Change Directory command first to access the particular folder and then I need to transfer the File.

To achieve the above task , I used the "Run Operating System Command " in the Receiver File Adapte, thats where I am using the above mentioned .BAT file.

1) I have the path to the FTP Server and using this I can directly connect to the Specific Directory

So for the above scenario I need to write a Shell Script, but I am not sure how to do the above task.

Could you please help me. Thanks.

Former Member
0 Kudos

hey

>>that , I need to use the Change Directory command first to access the particular folder and then I need to transfer the File.

well for this you need to use the Run OS command Before Message processing,Not after message processing.

secondly this shell script should run on the FTP server itself,not on the XI server.

Thanx

Ahmad

Former Member
0 Kudos

Hi,

I'm not sure you need to do this.

I think the problem is the user that you are using is set up on the FTP server with the default directory being incorrect.

I would suggest you get the user changed so it is accessing the directory you want or get a new user set up that defaults to the correct directory.

Alternatively, in the output file name make sure it is specified correctly with the directory name included. The directory path is relative to the FTP server you are logging on to.

The batch file running is unnnecessary in my eyes.

Cheers

Colin.

Former Member
0 Kudos

Thanks Ahamad.

Can you help me in writing the Shell script please?

Former Member
0 Kudos

and having that said about shell script,lemme explain a bit.

see shell scripts from File adapter will run only on the system where you have adapter framework installed(your XI system)

so you need to run a script on XI machine which will call another script on the FTP server to change the file path

and these scripts must be run before message processing

Thanx

Ahmad

Former Member
0 Kudos

Exactly Ahamad, I understood this point.

My user has asked me to use the following PUT command

i.e

put <SalesFile> %RZYSales%HOU%MEXICO%%b

So how should I achieve the above task, using the Shell script.

Thanks Ahamad.

Former Member
0 Kudos

Hey Jenni

i m not an expert in shell scripts:( but will definitely try my level best to help you out .

see my approach is

use NFS as the message protocol and deliver the file to some local folder on your XI machine itself.after that run OS level command after message processing(earlier i said OS command before processing but i waz wrong there).this OS script will copy the whole file and send to another file on the FTP server and will kickstart another script on FTP server which will change the file path first and then finally keep the file in the correct folder on the FTP.

Thanx

Ahmad

Former Member
0 Kudos

Yes Ahmad, exactly we are in Sync now. But I am not sure how to write a Shell script for this scenario .

Would some one guide me the step by step process to achieve the above task.

Greatly Appreciated.

Former Member
0 Kudos

Hey Jenni

another approach which might save you from all the hassle is

simply use FTP as the message protocol and dump the file on the FTP server in some temporary directory(suppose we call it C:/temp),now the FTP admin should write a script which should keep on looking in this C:/temp dir for any file and as soon as it gets any file there,it should change the file path and write the file to the correct directory.

i m thinking of this approach for few reason,first of all i m not sure if you have a local file server(NFS) on your XI machine itself or not.secondly you will save the overhead of moving the whole file from local file server to the FTP server.

just ask the FTP guy and if he can write that shell script on the FTP server itself,then it will solve the whole problem more effectively.

Note:We usually use OS level shell scripts in receiver file adapter to execute commands on XI server itself(for e.g renaming the file or changing the file format etc).

Thanx

Ahmad

Former Member
0 Kudos

Unfortunately, we can't write the Shell Script on the FTP server for few reasons.

The only option i have is I have to use the Shell Script, that's going to

1) Using the NFS File Protocol I need to write the Target file into XI server

2) Then Connect to the Remote FTP Server and to the Specific Directory

3) Then FTP the file from XI server to the Remote server.

Could some one help me to write a shell script please?

Thanks.

Answers (0)