cancel
Showing results for 
Search instead for 
Did you mean: 

Fileadapter: OS Command and error catching

Former Member
0 Kudos

We need to use scripts after file creation in an export file interface to perform some file operations.

Unfortunatly, the Audit log does not get the script output (STDOUT, STDERR) back and even worse, it does not get the return code back.

It always looks like everything was okay "OS Command successfully executed", no matter what the script does.

I know, there is a workaround to write my own log file like here http://scn.sap.com/community/pi-and-soa-middleware/blog/2005/08/17/xi-operation-system-command--erro...

1. Is there any better solution to catch script errors?

2. How can I monitor the errors without checking multiple logfiles?

3. Is there any way to get an "error" in the audit log caused by the script?

4. Is it possible to create an adapter module which executes a script and creates a proper logging?

I also recognized, that the OS Command execution does not seem to wait until the file is completely written. So, if you have a big file and the script that moves the file, it sometimes happens that the file is still empty. But PI doesn't care at all. I guess the only solution here is to add a "wait-command" in the script.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Heiko,

Please check this link:

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/44/556cb799c93677e10000000a114a6b/frameset.htm

2.  Under Timeout (secs), specify the maximum runtime of the command in seconds.

When this time interval is exceeded, the adapter continues processing. The executable program continues to run in the background.

The adapter writes the output (STDOUT and STDERR) for the operating system command in the system trace.

Also check this:

Note 1334947 - OS command trace(logs) - File Adapter

Regards,

Beena