calling a shell script from another server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting calling a shell script from another server
# 1  
Old 08-09-2012
calling a shell script from another server

hi All,

There is a requirement where i need to call a script which is on another server(say server2).
Any pointers on how i can achieve this?

I tried the command
Code:
ssh **ipaddress** /home/mqm/jay.sh

but its not working...after typing in the command the cursor goes to the next line thats it......

Please help me on this
Thanksin advance

Last edited by Franklin52; 08-09-2012 at 05:20 AM.. Reason: Please use code tags for data and code samples
# 2  
Old 08-09-2012
In priciple, this is correct. You can test it with e.g. ssh **ip** ls -l. Maybe your script expects some terminal input?
# 3  
Old 08-09-2012
check

the syntex is correct. please check key sharing, ping, connection b/w both systems. also check if there script requires some input from user
# 4  
Old 08-09-2012
First, check if you need to create the key or if you already have one:
PHP Code:
ls -~/.ssh/id_
then

ssh-keygen
ssh-copy-id remote
ssh-add -l
# 5  
Old 08-09-2012
This Thread is developing into a guessing game.

Please post what Operating System and version you are running on both computers and what Shell each computer uses.

Please post the contents of /home/mqm/jay.sh. We would be looking for lines containing Shell read commands.

Have you tried ssh -n switch in case your script is picking up input not intended for it.
# 6  
Old 08-10-2012
Hey,

Could me explain me liitle more,you want perfrom a task, for which you are running the scripts on server 1,in between of task you need input or output from server 2 or you want run the script from one server to another.??

After this i can provide extact syntax..

Regards
Nick
# 7  
Old 08-10-2012
calling a shell script from another server

Hi,

I have a script in server1 which checks the all the directories if any unprocessed messages are there or not. It creates a file mailinfo.txt on that server which has the information of the directories having unprocessed messages. At the end of the current script i need to call a script( say action script) on server2. The action script(from server2) just has to check the size of mailinfo.txt on server1 and if its 0 send a mail saying 'there are no unprocessed files in the directories" and if the size is more than 0 send out the mail with the content of the mailinfo.txt.

P S: i have to send the mail fromsever2 only as the firewall restriction on server1 doesnt allow to send out mails.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling shell script within awk script throws error

I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks sh: -c: line 0: syntax error near unexpected token `newline' sh: -c: line 0: `./billdatecalc.sh ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies

2. Shell Programming and Scripting

Calling script located at server-B from server A

i am using HP-UX, i am writing a shell script to call a script located at server-B from server A. i am able to ping Server-B from Server-A (working ), what all the environment varaibles i need to set to call a script located at server-B from server A. --------- #!/bin/sh... (3 Replies)
Discussion started by: only4satish
3 Replies

3. Shell Programming and Scripting

calling a shell script present on another server using perl script.

Hi, I am working on a sever A. I want to write a perl script to execute a shell script persent on the server B. please help me in this. thanks in advance. (3 Replies)
Discussion started by: anandgodse
3 Replies

4. Shell Programming and Scripting

How we can pass the argument when calling shell script from perl script

Can someone let me know how could I achieve this In one of per script I am calling the shell script but I need to so one thing that is one shell script call I need to pass pne argument.In below code I am calling my ftp script but here I want to pass one argument so how could I do this (e.g:... (5 Replies)
Discussion started by: anuragpgtgerman
5 Replies

5. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

6. Shell Programming and Scripting

Calling another shell script

Hi there, I have an script reading content of a file and runs whatever command is specified there, as follows #!/bin/bash # Supposed to read from a file that commands are listed to be run # when the server starts for initialization CMD_FILE=/myScripts/startup/task2do.txt if ; then ... (2 Replies)
Discussion started by: james gordon
2 Replies

7. Shell Programming and Scripting

calling a script in remote server

Hi, I need to call a shell script present in the remote server from the shell sript in my server. Can any one help to do this ASAP... Thanks (1 Reply)
Discussion started by: Preet
1 Replies

8. Shell Programming and Scripting

Calling shell functions from another shell script

Hi, I have a query .. i have 2 scripts say 1.sh and 2.sh 1.sh contains many functions written using shell scripts. 2.sh is a script which needs to call the functions definded in 1.sh function calls are with arguments. Can some one tell me how to call the functions from 2.sh? Thanks in... (6 Replies)
Discussion started by: jisha
6 Replies

9. Shell Programming and Scripting

Calling Shell Script

Hello Friends, I have bash script on unix server which i want to call from windows server. Basically i want a command line which will call this script on unix server. Any one has any idea regarding this? Help really appreciated!! Thanks, Roshni. (1 Reply)
Discussion started by: onlyroshni
1 Replies

10. Shell Programming and Scripting

Calling shell script ?

hi friends, i'm new to unix and straight away i had to start with the script files. I've a script file which gets called from a menu item on a GUI. This script file again calls .awk file, in performing some tasks , which also generates certain files. I modified the files to generate some... (1 Reply)
Discussion started by: Ravi_Kandula
1 Replies
Login or Register to Ask a Question