cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP - OS Commands after processing

Former Member
0 Kudos

Hi!

Can someone help me with os commands after processing? It's not working...Is there something wrong with my command?

Command: mv "test.csv" "/xfer/chroot/transfer/xxisftp/test/SOI020/Receiver/Test/test.csv"

This is from workbench log:

12/30/2014 4:25:17.251 PMInformationsend test.csv to /xfer/chroot/transfer/xxisftp/test/SOI020/Receiver/
12/30/2014 4:25:17.252 PMInformationExecuting OS command: mv "test.csv" "/xfer/chroot/transfer/xxisftp/test/SOI020/Receiver/Test/test.csv"

So it seems that it's executing my command but the file is not moved to the Test directory. What can be wrong?!

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Stefan,

Hace you tried to use absolute paths?

Have you tried to do a shell script and to call it?.

Regards.

Former Member
0 Kudos

I have tried to use absolut paths...you mean something like this right?

mv "/xfer/chroot/transfer/xxisftp/test/SOI020/Receiver/test.csv" "/xfer/chroot/transfer/xxisftp/test/SOI020/Receiver/Test/test.csv"


I have not tried to do a shell script...It should be possible to do it this without using a script right?

baskar_gopalakrishnan2
Active Contributor
0 Kudos


Create a shell script and there list your mv commands etc and call the script.. This would work. Also make sure user role specified has access to execute the script.

Former Member
0 Kudos

Ok, I will try this. But I think i will need some basis support right?

It would be best if I could use the os commands line without shell script though... So keep me updated if you have any more ideas.

Former Member
0 Kudos

Hi ,

Can you once try using as follows:

mv /xfer/chroot/transfer/xxisftp/test/SOI020/Receiver/test.csv /xfer/chroot/transfer/xxisftp/test/SOI020/Receiver/Test/test.csv

I checked some documentation and Unix move command does not use a quotation. For example a link below.

Linux and Unix mv command help and examples

Thanks,

Sudhansu

Former Member
0 Kudos

Sorry, same result

Maybe I could talk top the SFTP admins to try to look into their logs and make sure my command is actually executed.

PI tells me it is, but I'm not sure.

former_member184720
Active Contributor
0 Kudos

>>>Maybe I could talk top the SFTP admins to try to look into their logs and make sure my command is actually executed.

I'm not sure if I misunderstood but this OS commands get's executed on PI operating system but not on the SFTP server.

Former Member
0 Kudos

I understand they are executed from PI system, but I'm thinking, somehow the commands need to reach the SFTP, right?

former_member184720
Active Contributor
0 Kudos

>>>I understand they are executed from PI system, but I'm thinking, somehow the commands need to reach the SFTP, right?


No. If you want to execute some command on SFTP server then you'll to write some java/perl script again which will connect to SFTP server and execute those commands.

Then in PI channel you have to write a command which will execute that script.

The command that you write under PI channel, will be directly executed on PI Operating system.

Former Member
0 Kudos

Oh.... Ok, but if this is true then of course this will not work 🙂

I want to move the file on the SFTP-server. So the only way to achieve this is to make a script that connects to the sftp server and move the file?

iaki_vila
Active Contributor
0 Kudos

Hi Stefan,

Although this wiki http://wiki.scn.sap.com/wiki/display/XI/SAP+XI+File+Adapter+OS+Command+Line+Feature is for FTP, you can check that the shell script needs to do the authentication as well. The SFTP adapter should work in the same way.

Regards.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please check if you have the assigned role: SAP_XI_CONFIG_FILE_OS_CMD_J2EE as per sap help.

Defining OS Commands for Message Processing by SFTP Adapter - SAP NetWeaver Process Integration, sec...

Thanks,

Sudhansu

Former Member
0 Kudos

Hi,

Yes, this is done. Also, I think that if this role is missing the OS Commands will not even show. And I have no problem defining the commands, they're just not working 😕

Former Member
0 Kudos

file name is hardcoded or using placeholders?

Former Member
0 Kudos

It's hardcoded as you can see above