cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.30: OS command on AIX to archive files on FTP does not work

peter_wallner2
Active Contributor
0 Kudos

Dear experts,

Our PI system runs on an AIX server.

I have a scenario PI --> FTP. I also need to archive files in a seperate folder on the FTP.

I have been following thread:

After file processing in the Audit Log in RWB I among others I get the information:


Execute OS command "sh /usr/sap/SYS/flex/batches/archive.sh file.zip /ftpfolder/file.zip"

It seems it is working properly.

The file itself gets processed to the "ftpfolder". But in the archive folder I do not get a copy of that file.

My script looks like this:


#!/bin/ksh
ftp -n -v <<%%EOF%%
open ftpserver
user myuser mypassword
prompt
asci
cd archivefolder
mput $2
bye
%%EOF%%

In the file receiver I have "Run OS command after message processing":

"sh /usr/sap/SYS/flex/batches/archive.sh %f %F"

%F stands for the complete path, right? So if I say "mput $2" in my script it should use %F.

Could you please help me out here. I really don't know what the problem could be.

Thank you and best regards,

Peter

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi Peter,

>>>I have a scenario PI --> FTP

but FTP does not support OS command as far as I remember

correction:

"Note that for the File Adapter transport protocol "FTP", the operating system command is NOT executed on the FTP server, but on the server hosting the Adapter Engine."

please check for details:

Note 841704 - XI File & JDBC Adapter: Operating system command

Regards,

Michal Krawczyk

Edited by: Michal_Krawczyk_PIXI on Feb 3, 2012 3:38 PM

Answers (1)

Answers (1)

former_member184681
Active Contributor
0 Kudos

Hi Peter,

Most probably the OS command gives you an error, but you are not able to see it in PI (standard PI behaviour). But you can check the output from your script by using a smart trick described by Michal in one of his blogs:

So simply try to send the output of your script to a log file and analyze the outcome - you should find the reason for your problem there.

Hope this helps,

Greg