Call one script from other script lying on different servers.

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Call one script from other script lying on different servers.
# 1  
Old 04-23-2014
Call one script from other script lying on different servers.

HI All,

I have a requirement of execueting a Shell script on serverA, which is going to execute an application script ( Hyperian Planning script ) on serverB. Can any one please help in how to achieve this?

e.g.

script abc.ksh runs on serverA.

internally abc.ksh call a script def.msh (def.msh resides on serverB).


Appreciate your help.

Thanks
# 2  
Old 04-23-2014
If serverA can ssh into serverB you can, in serverA's script do this:
Code:
ssh root@serverB '/path/to/script/def.msh'

you can substitute root with the actual user you have login for and access to the script
if you need a different shell to run your script use that shell's execute flag, with bash it'd be something like
Code:
ssh root@serverB "bash -c '/path/to/script/dev.msh'"

# 3  
Old 04-23-2014
Thanks Deimos.

Is ther any alternative to achieve this? I am not sure whether I can use ssh Smilie
# 4  
Old 04-23-2014
Hi alok,

You could use remote shell or rexec

Code:
rsh serverB /path/to/script/def.msh

or

See the post here

launching script via REXEC

Regards

Gull04
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script to call and sort awk script and output

I'm trying to create a shell script that takes a awk script that I wrote and a filename as an argument. I was able to get that done but I'm having trouble figuring out how to keep the header of the output at the top but sort the rest of the rows alphabetically. This is what I have now but it is... (1 Reply)
Discussion started by: Eric7giants
1 Replies

2. Shell Programming and Scripting

awk script to call another script based on second column entry

Hi I have a text file (Input.txt) with two column entries separated by tab as given below: aaa str1 bbb str2 cccccc str3 dddd str4 eee str3 ssss str2 sdf str3 hhh str1 fff str2 ccc str3 ..... ..... ..... (1 Reply)
Discussion started by: my_Perl
1 Replies

3. Shell Programming and Scripting

Call a Perl script within a bash script and store the ouput in a .txt file

I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients). I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
Discussion started by: mecaka
6 Replies

4. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

5. Shell Programming and Scripting

Script to call a menu script and redirect each option to a text file

Hello, I want to design a script that will call an existing menu script and select options one by one and redirict the out put to a file. For example;- In the script MENU.sh there are 10 options i want to design a script MENU2.sh that will select option 2 3 4 6 7 10 and redirict the output... (4 Replies)
Discussion started by: spradha
4 Replies

6. Shell Programming and Scripting

Need bash script to ping the servers and rename the output file each time the script is ran

HI, I have a file serverlist in that all host names are placed. i have written a small script #./testping #! /bin/bash for i in `cat serverlist` do ping $i >> output.txt done so now it creates a file output.txt till here fine.. now each time i run this script the output file... (4 Replies)
Discussion started by: madhudeva
4 Replies

7. Shell Programming and Scripting

Call shell script function from awk script

hi everyone i am trying to do this bash> cat abc.sh deepak() { echo Deepak } deepak bash>./abc.sh Deepak so it is giving me write simply i created a func and it worked now i modified it like this way bash> cat abc.sh (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

8. Shell Programming and Scripting

Running a script in system() call and want the script's output

Hi All, I have a script(sample.sh) displaying the output of "dd" command. Now i am using this script in system() call as, system("sh sample.sh") in an application file. I want the output of system("sh sample.sh") in the application file itself. How can i get it? Many thnaks.... (9 Replies)
Discussion started by: amio
9 Replies

9. Shell Programming and Scripting

how to run script? call other script? su to another user? make a cron?

Good morning. I am searching for "how-to"'s for some particular questions: 1. How to write a script in HP-UX 11. 2. How to schedule a script. 3. How to "call" scripts from the original script. 4. How to su to another user from within a script. This is the basics of what the... (15 Replies)
Discussion started by: instant000
15 Replies

10. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies
Login or Register to Ask a Question