cancel
Showing results for 
Search instead for 
Did you mean: 

OS command in File Sender Adapter

Former Member
0 Kudos

Hi ALL,

We have a requirement in Sender file FTP scenario to check for a Trigger file first before picking the actual data file.becuase the sender sytem genartes a trigger file after data file is created so we have to check for the trigger file first and then process the data .

Now I am planning to use OS command to achive this requirement

Step 1

OS command before message Processing will check for the trigger file in the FTP server and if the file exist then will allow the file adapter to process the actual data file. Else to throw a time out error.

Question : we put our script in our PI system and will point to that script %F (absolute file name including path) ,is that possible for that script to connect to the FTP system and check for the trigger file..? How can I achieve this .. ? pls if possible send me the Script

Step 2:

In OS command after message Processing I will search for the same file and delete it.

Thanks

Shakeif

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

You can achieve this requirement in 3 ways

1)Writing UNIX Script and run through OS Command,

We can connect to FTP Server and you can check for the file ,if exists then File adapter will process the file else specify the timeout value in Adapter it will through the Time out error.

But make sure that the logic you have written is correct,may be contact basis people.

2)Write a UNIX Scripting program to copy the file from cureent folder to other newfolder,

Executing the UNIX program at Server level to copy the same,in this case no need to throw an exception,when file available in new directory adapter will pick up the data,and select processing mode delete,and it will delete.

The UNIX scripting logic Just copy file from one directory to other.

3)Writing JAVA Proxy to connect FTP Directory ,write lofic as per requirement.

Regards,

Raj

Former Member
0 Kudos

You can achieve this requirement in 3 ways

1)Writing UNIX Script and run through OS Command,

We can connect to FTP Server and you can check for the file ,if exists then File adapter will process the file else specify the timeout value in Adapter it will through the Time out error.

can you pls tell me the command to connect to the FTP sever to be written in the Script . i can write for the serch option ?

But make sure that the logic you have written is correct,may be contact basis people.

2)Write a UNIX Scripting program to copy the file from cureent folder to other newfolder,

Executing the UNIX program at Server level to copy the same,in this case no need to throw an exception,when file available in new directory adapter will pick up the data,and select processing mode delete,and it will delete.

The UNIX scripting logic Just copy file from one directory to other.

3)Writing JAVA Proxy to connect FTP Directory ,write lofic as per requirement.

Regards,

Raj

rajasekhar_reddy14
Active Contributor
0 Kudos

I am not sure about scripting,better google it

Regards,

Raj

Answers (0)