cancel
Showing results for 
Search instead for 
Did you mean: 

OS Commads -- File receiver adapter UnixScript required

Former Member
0 Kudos

Hi Experts,

My scenario is integration between 2 ftps , one sender and receiver communication channel, I am able to pick up the file and sending it to receiver FTP directory.

But I want to copy one specific file from sender FTP to Receiver FTP after successful processing of message. I am looking out to use RunOS commands after message processing option.

File name is Status.xml; need to be copied over to Receiver FTP.

My PI system on UNIX/LINUX OS.

Looking for your valuable inputs.

Regards,

Jam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Instead of using OS commands, you can modify the existing interface,

so that this second file after successful message will be posted at target.

-Supriya.

Former Member
0 Kudos

No, I am looking for handle this requirement using UNIX Script.

Former Member
0 Kudos

Hi ,

This can be handled in UNIX/Linux. The command for your help is "scp" (secure copy).

The Syntax of the command is:

scp [[user@]from-host:]source-file [[user@]to-host:][destination-file]

eg:

scp myuser@10.1.2.2:/home/miguel/source.xml MYUSER@10.1.2.3:/home/miguel/source.xml

This command will prompt for a password. So, you must visit this link to know how to scp without a password.

http://www.hostingrails.com/HowTo-SSH-SCP-without-a-password

My suggestion would be to first try if this command works from your shell prompt(with a password).

Regards, Gaurav.

Former Member
0 Kudos

>

> scp myuser@10.1.2.2:/home/miguel/source.xml MYUSER@10.1.2.3:/home/miguel/source.xml

>

i can call this command in File receiver adapter right?? actually i am looking for commands to execute in Adapter level,not OS level.

Former Member
0 Kudos

In your file receiver channel, you have the option of calling/running an OS command on the PI Server after the message is successfully processed by the file reciever channel.

You can include the scp command in a shell script and call this shell script in the file receiver channel with its relative path. Example:

/home/mydir/myscript.sh

Specifically, you can call the above command directly from the File channel.

But, the above command will prompt for a password. Hence, i pointed you to the link above, by which you can call this command without a password. In order to check if this command works fine for you, just test this command on the PI Server on the Shell prompt. So, you will need to have a username/password for both the FTP servers invloved here.

Edited by: Kr.gaurav on Sep 3, 2010 9:26 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gaurav,

I tried to execute a JAR file given by client and it generates the encrypted file with alphabet "e" followed by actual file name in the same folder, the commands used in command prompt is  " Java –jar  <<name of the jar file>>.jar  <<full path of the file>> ". Kindly suggest me how to execute automatically and call the same in PI receiver channel.

Thanks,

Nithin.