954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

remote command exexcution

Hi Friends
I have two server
1. server 1
2. server 2
I want to execute a shell script in server 2 from server 1.
shell script will returns few data i need to check in server 1
Please help me in this

ramukumar
Newbie Poster
7 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

What Operating Systems on both?

rch1231
Posting Shark
959 posts since Sep 2009
Reputation Points: 119
Solved Threads: 142
 

solaris 5.10

ramukumar
Newbie Poster
7 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Ok several options. Just execute a script look into rsh and rlogin which allow you to open a shell on another UNIX/Linux/Solaris/irix/hpux system.

If you have httpd (and php for php scripts) running on the remote server you could set up a web page with the cgi script (or php if installed) and show the results on in a browser.

If you need the script run regularly and the output available to review then on the remote server set up a script with cron (crontab) to generate your output and then pull it to your local server to evaluate with ftp or wget.

rch1231
Posting Shark
959 posts since Sep 2009
Reputation Points: 119
Solved Threads: 142
 

HI I am new to shell scripting can u explain with example

ramukumar
Newbie Poster
7 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Example of rsh use, the following executes the command mkdir testdir as user remoteuser on the computer host.example.com:

rsh -l remoteuser host.example.com "mkdir testdir"

rch1231
Posting Shark
959 posts since Sep 2009
Reputation Points: 119
Solved Threads: 142
 

shall i use the same to execute a script in the remote server

ramukumar
Newbie Poster
7 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

rsh executes the any command or script on the remote server provided the user you are connecting with has permission to execute the script in question. And the answer to your question is Yes.

rch1231
Posting Shark
959 posts since Sep 2009
Reputation Points: 119
Solved Threads: 142
 

I got the following error
"No route to host"

ramukumar
Newbie Poster
7 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

It would help to know what your command line was when you got the error...

Can you ing the host at the address you are using?

rch1231
Posting Shark
959 posts since Sep 2009
Reputation Points: 119
Solved Threads: 142
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: