on 04-26-2016 9:24 AM
Hi Experts,
What should be typed on "Command Line" of Run operating system command Before/After Message processing to execute/call a shell script located on the physical path of PI application server. Actually when I execute manually a test script by using command "./<filename>.sh" which works on Putty but what command should be typed on channel config to call the same shell script located on PI server box. For example say test2.sh is the shell script file located on path /PI_Path/system/. Now pls help on the command to be typed on comm channel.
Thanks,
Nithin.
Hi Nithin,
In a similar way as you call script in Putty, you specify it in communication channel's run operating system command before/after message processing (including parameters that you pass to that script, in case of any). Just if you use any user specific aliases for directories, it is recommended to replace them with a path that is recognized by the user, in which context the OS command is executed by PI (<sid>adm), and that the mentioned user has execute permission for the called script.
Regards,
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Nithin,
I believe your PI system is running on Unix OS. If Unix, then the command line argument is different. Please look at the last part of the wiki for the command?
SAP XI File Adapter OS Command Line Feature - Process Integration - SCN Wiki
Regards,
Nitin
Hi Nitin,
Thank you for the reply. I specifically need the command that should be filled/typed on the "command line" tab under 'Run OS command before/after Message Processing' section of the comm. channel. In the above example already tried syntax like "/PI_Path/system/test2.sh" , "/PI_Path/system/test2.sh %f" , "/PI_Path/system/test2.sh %F" but nothing worked, but manually when I execute the script using user <sid>adm it works. Hence, please guide.
Thanks,
Nithin.
Hi Nithin,
maybe try to enter the following entry in the communication channel under 'Run OS command before/after Message Processing' :
sh script-name-here.sh
And ensure that the script-name-here contains the correct absolute path to the file.
You might also try to run it first on OS level to see if it is working.
Best Regards,
Viktor
Hi Nithin
It would be:-
/PI_Path/system/test2.sh
Refer the following Wiki for more detais:-
SAP XI File Adapter OS Command Line Feature - Process Integration - SCN Wiki
Regards
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eng,
For practice say here I am writing here a very simple script say create a new folder later to that I will write script required for client. The script file say test2.sh here contains the below code:
"#!/bin/sh
mkdir TESTFOLDER" which creates the new folder on same path where script is placed and I am using the same syntax as suggested by you but it does not create any new folder.
Thanks,
Nithin.
Nithin, can you log into shell of the PI system (e.g. using Putty) using OS user <sid>adm and attempt to execute the developed script? In Linux environment, scripts executed by communication channel, are executed in context of that OS user. This test is just to eliminate any user account related issues.
Regards,
Vadim
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.