cancel
Showing results for 
Search instead for 
Did you mean: 

Shell Script not getting invoked in File adapter

Former Member
0 Kudos

Hi all,

Requirement:

PI need to pick the file from source directory and send it to target directory using SFTP.

I'm using SCP command for this purpose.

When I run the shell script (with simple SCP command) from command prompt, script is working fine.

Same script is called from PI File adapter but script is not getting invoked.

In the communication channel logs, "Executed OS command" is available. There are no Error/Warning messages in the log.

NFS transport protocol is used in the File communication channel.

Complete directory path of the shell script is mentioned in File channel -> Run Operating System command after message processing.

Even the following simple command is not working from PI receiver file channel:

echo "Test file" >> /data/test.txt

Please let me know if I'm missing out something.

Thanks,

Geetha

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi all,

Issue resolved. Username did not have proper authorizations to establish SFTP connection to the target server.

Thanks,

Geetha

0 Kudos

Hi Geetha ,

I'm also facing the same issue command is executing but the the file what I'm excepting is is not updating .

could you please help me what authorizations are missing it will be really helpful to me .we are using the single stack PO 7.5

I hope you will see me message reply back and help me out from this issue.

Thanks & Regards

Bharath

martin_dejl2
Participant
0 Kudos

If you have Abap stack and Java stack on one machine, they share the same filesystem. It means you can try, just for test, create command in TA SM69. It can help you to identify your problem - you shall see the output from the shell there.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>>Even the following simple command is not working from PI receiver file channel:

>> echo "Test file" >> /data/test.txt

Is your script has beginning line as follow...

#!/bin/sh

martin_dejl2
Participant
0 Kudos

Hi Geetha!

check this [wiki|http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature].

On Unix you have to start all your commands with 'sh'. In your example it should be something like: sh echo "Test file" >> /data/test.txt'

or as mentioned in previous post and also on wiki page, write your command(s) into executable .sh script and just start the script with 'sh <<yourscript.sh>> %f'.

udo_martens
Active Contributor
0 Kudos

Hi Geetha,

the os command is executed on PI server, not on FTP server.

Regards,

Udo

Former Member
0 Kudos

Hi Udo,

I'm executing the OS command from PI server only.

The shell script is placed in PI server at the OS level and the full directory path of the shell script in PI server has been mentioned in the file receiver channel.

Thanks,

Geetha

Former Member
0 Kudos

Hi Geetha,

I think the syntax u are using is not correct. Please follow the below syntax:

/path/<script_name> %F

for ex: /staging/Interface/XI/Script/FTPData %F

use the above in the communication channel.

%F should be after a space.

FTPData is the script name

/staging/Interface/XI/Script/ is the location where the script is present

Cheers,

Souvik

Edited by: Souvik Chatterjee on Apr 14, 2011 3:38 PM

Former Member
0 Kudos

Hi Geetha,

Try moving the file to PI server file system first. Then run the script. Then it might work.

Regards,

Aravind