"URGENT"How can i execute shell script from a remote server ?
Hi all,
Problem statement:I have configured passwordless ssh between two servers A & B.Now i want to start & stop one tomcat server(instaled on sever B) from server A. I am executing this command: ssh serverA " sh cd {path to the directory where tomcat is installed) startup.sh" Error message:"Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program." But both java_home & jre_home is defined correctly on server-B in ~/.bash_profile. Please provide help in this. Regards Amit giri |
why is this urgent ? (i almost didnt click on it)
i would do: Code:
ssh serverA "/path/to/startup.sh" Code:
ssh serverA |
Agreed with the last poster... Very simple.
Just ssh into the box and run the script. |
I guess both of you have not read the entire problem statement.
I am facing problems with the JAVA_HOME setup on server B.
The script that i want to trigger requires JAVA_HOME. Now when i checked on server B for JAVA_HOME i found that it was configured correctly in ./bash_profile. Regards |
But if you want to run the command on server A, the variable should be defined there. Is not it? Or am I still missing something?
|
Quote:
To run a program on server A, server A must be set up correctly, whereas server B's setup won't be of any benefit. Your command -- Code:
ssh serverA " sh cd {path to the directory where tomcat is installed) startup.sh" |
What about shell type/env setup?
SSH with and without command gives different results? env is different? works as expected Code:
[a ~]$ ssh 172.24.40.100 Code:
[a ~]$ ssh 172.24.40.100 /path/script.sh 'launch' in from a, and 'run' it on b!? (Was posted here but better here!) |
Quote:
|
AND.....the OP is gone. After getting help the OP does not even care to come back and say if the issue is resolved or not.
|
Quote:
Hey i am still here but my problem get resolve by defining the JAVA_HOME explicitly in my script that i am executing. i.e i defined export JAVA_HOME="path to java_home on server B". Anyways thanks alot for your precious time. Regards Amit giri |
All times are GMT -5. The time now is 04:02 PM. |