cancel
Showing results for 
Search instead for 
Did you mean: 

OS Command in NFS not executing

Former Member
0 Kudos

Dear All

I am trying to execute a script before message processing in sender file communication channel with transport protocol NFS.

Although in my cc message display logs says:

Information Execute OS command "sh displayDate.sh"

but none of the commands inside the script is running.

I am using PI NFS directory as the location to place the script and executing it.

As the script is running fine when executed in command prompt there is no problem with the content script

Please help

Regards

Sourabh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sourabh,

Please provide the complete path name (absolute path name) of the Shell script that you are trying to execute. Eg:

/usr/sap/bin/displayDate.sh

where,

the shell script is "displayDate.sh"

and it is available in the folder: /usr/sap/bin

Note: The OS Command for the file adapter only runs on the system in which the Adapter Framework is running.

I hope this helps.

Regards, Gaurav.

Former Member
0 Kudos

Hi

I have changed the command line to

/bin/sh piuser:/interface/PI/displayDate.sh

Still same problem

markus_doehr2
Active Contributor
0 Kudos

> /bin/sh piuser:/interface/PI/displayDate.sh

Rather than doing "sh <something>" insert

#!/bin/<yourshell>

into the script, add execute permissions and call the script directly. The output will not come since it's "taken" by the 'sh'.

Markus

Former Member
0 Kudos

Hi

i have changed to first line of the script to

#!/bin/displayDate.sh

and calling the script following in the command line:

sh displayDate.sh

sh /interface/PI/displayDate.sh

It is still not working...

markus_doehr2
Active Contributor
0 Kudos

> #!/bin/displayDate.sh

Wrong! Use

#!/bin/sh

or

#!/bin/ksh

depending on what shell you use.

Then execute

chmod 755 displayDate.sh

Then logon as <sid>adm and execute

$ /interface/displayDate.sh

without a prepending "sh".

Markus

Former Member
0 Kudos

hi

Executing the script was never a problem in command prompt. It is executing using

$ /bin/sh displayDate.sh

The problem is executing the same script using the OS Command in the adapter

I have done chmod 777 displayDate.sh in the command prompt

Now when trying to execute the script using command line in adapter:

/bin/sh displayDate.sh

the script is not executing

markus_doehr2
Active Contributor
0 Kudos

> Now when trying to execute the script using command line in adapter:

>

> /bin/sh displayDate.sh

Again:

Do NOT (!!!!) prepend /bin/sh before, just execute the script with full path.

Markuse

Former Member
0 Kudos

getting following error

Warning Error executing OS command "/interface/PI/displayDate.sh".

markus_doehr2
Active Contributor
0 Kudos

> Warning Error executing OS command "/interface/PI/displayDate.sh".

Ok!

now check the system log (SM21) for possible problems.

Markus

Former Member
0 Kudos

Hi Markus

In SM21 follwing is stated

Error in technical configuration Error during the retrieval of logon data stored in

as there is no further information can we say that

There is error in the script: but script is running fine on command prompt

There is error in adapter configuration: in that case the scenario should not execute at all

Please suggest as what can be taced out from the log message

markus_doehr2
Active Contributor
0 Kudos

> In SM21 follwing is stated

> Error in technical configuration Error during the retrieval of logon data stored in

Also in long text? You may check the corresponding workprocess trace, see the second and third column in SM21, then open ST11 and check the corresponding dev_wXY trace for more information.

> There is error in the script: but script is running fine on command prompt

Is the script on command line also working in the same user context/with the same user as the SAP system is running? If you can't share the information that's in the script it's very difficult to help, check the workprocess traces, maybe they'll reveal something.

Markus

Former Member
0 Kudos

hi

My script looks like this:

code

-


#!/bin/sh

echo `date` Start > Execute1.txt

REAL_TZ=$TZ

TZ=CUT168

date "+%d %m %Y"|read dd mm yyyy

TZ=$REAL_TZ

var1=$dd-$mm-$yyyy

find . -name "$var1*" | xargs -I{} mv {} ./OUTPUT

echo `date` End > Executeend.txt

-


I am going through the traces in Sm21 and ST11 but till now haven't encountered any relevent information.

markus_doehr2
Active Contributor
0 Kudos

I execute that exact script on an NFS mounted directory - and I got the two files in the workdir of the instance (/usr/sap/<SID>/DVEBMGS00/work).

What exactly "is not working" on your side? What do you expect to happen and what does actually happen?

Markus

Former Member
0 Kudos

Hi

The script's role is tome move a set of files from the interface/PI/ directory to interface/PI/OUPUT directory which is not happening when trying to execute it from the file sender communication channel

The two files should also be created in the mount directory which is also not happening

Sourabh

markus_doehr2
Active Contributor
0 Kudos

If you want to move files around you need to use full paths.

The rundirectory is the instance work directory - so use full paths.

Markus

Former Member
0 Kudos

Hi

I have changed the paths to the full directory paths but still nothing in the script is working...

Apart from moving the files I am aslo trying to create files in the same directory which is also not happenning

markus_doehr2
Active Contributor
0 Kudos

There must some issue on your system, without access I can't help you further.

Try to echo the output instead of actually try to move something.

Markus

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

Where you placed script?? if you placed in NFS directiry, specify complete path in Communication channel and check the script what you have written should be correct.

Regards,

Raj