Running a script on a different Sever


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Running a script on a different Sever
# 1  
Old 05-24-2004
Question Running a script on a different Sever

Guys,

I want to run a script located on a different server from my pc.
Let say the server has an IP of 1.1.10.2/16 and the script path is:

/home/user/bin/check.sh

The script scans for all available devices on the lan.


My pc has an IP of 1.1.15.4/16 and I can ping the sever and can connect to it, but I want to do things from my Sun.

Here is my code

for x in $check.sh
do
ping $x
done
/bin/ksh: check.sh: not found

Obviously I don't know how to tell my code how to connect to the server
I have asked and none of my friends at work know how to do this.

thank you
Tony
tony3101
# 2  
Old 05-24-2004
Hmm.... could you not just make things easy on yourself and SSH into the machine and run the script from there (or just copy the script to your PC using scp and run it locally)??

The syntax of your code will not work - it is looking for a variable called "check.sh". If you had a list of IP addresses you could try something like
Code:
while read line
do
    ping $line 2
done < my_list_of_ips

as you're using Solaris this should just give a nice "x.x.x.x is alive" message or timeout after 2 seconds (that's what the "2" is there for, as the default is 20 seconds and with a long list of IPs you'll be waiting a while if hosts are offline - this is Solaris ping - adjust the syntax for your OS)

Cheers
ZB
http://www.zazzybob.com
# 3  
Old 05-24-2004
Thank you zazzybob

I was actually trying to make things easier on myself. You see, many users have access to /home/user. The code I posted is an example, I'm actually adding more stuff into it like sensitive information that I do not wish to share to the whole group. Thats why I want to run it from my pc.

I wonder if I add the fully-qualifed name for check.sh on my .kshrc profile works....

tony
tony3101
# 4  
Old 05-24-2004
OK I have scp the file to my PC and it works.

Thank u
tony3101
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

LAMP Sever

How do I install a LAMP server on a new installation of Debian 9 using the lalest versions of AMP? Here is what I have. Corrections please. MYSQL apt-get install mysql-server mysql-client You can verify the MySQL server status using command: systemctl status mysql ------- PHP7... (0 Replies)
Discussion started by: Meow613
0 Replies

2. Red Hat

Cloning an empty sever (except OS) onto a smaller drive?

Actually this is a Centos 6.x question, but I think it fits here. I have a client that has a pretty beefy server that will be running all sorts of VMs once I unleash it to the developers. For several reasons, they would like to do a complete clone of the server as is right now, that is with just... (2 Replies)
Discussion started by: xdawg
2 Replies

3. BSD

Ping remote sever, nc, telnet, whatever

I put this thread to shell and bsd, because I want to resolve this matter on bsd. May somebody can explain to me how to ping a remote server, in unix. BTW the following code examples were tried on a linux system as well, with the same output, nothing. But on my bsd are not installed nmap neither... (4 Replies)
Discussion started by: 1in10
4 Replies

4. Shell Programming and Scripting

Need to Take Sent Mail Backup in Linux Sever

Everyday my code will send 100's* of mails from linux server to outlook using*sendmail command . I need to take a backup of those mails which are exactly sent from my linux server. This is needed for backup purpose. backuplocation is my local home dir.Is it possible to do this. I dont have root... (4 Replies)
Discussion started by: mohanalakshmi
4 Replies

5. Shell Programming and Scripting

Compare file in other sever

Hi All, I have totally two server. First server name is ABC which contains the file name is Sum.txt and Second server name is Sun here one file generate during the runtime. Currently I am in First Server. Now, I need to compare the server one file (Sum.txt) with server two file. If it... (2 Replies)
Discussion started by: suresh01_apk
2 Replies

6. AIX

Aix 5.3 NIS Client from a Suse10 sever

Hello Guys, Unfortunately after look for it on entire www I did not find anyone that have made a tutorial how to make it works. I'm using an AIX 5.3 as a nis client from a SUSE 1.0 server. I can see the maps - ypcat passwd (so I can Bind server) and I can su NIS users. BUT I CAN... (0 Replies)
Discussion started by: michelan
0 Replies

7. Shell Programming and Scripting

need to check whether a sever is pingable or not inside the script

Hi, need to write a script which will check number of ip address are able to ping or not .. (2 Replies)
Discussion started by: mail2sant
2 Replies

8. Programming

launching browser from Java on headless sever

I have a web based app that I need to launch from time to time using Java. The app only runs in a browser window so I need to get that running. I used OS X for my development and it runs fine on my laptop running the server on localhost. But when I deploy (in an oc4j container in a Solaris... (4 Replies)
Discussion started by: Solerous
4 Replies

9. Shell Programming and Scripting

Run command on remote sever from script

I have two redhat linux server. i have created one script which contain some command that run on Local server as well as remote server.I am using this command to connect to remote server ssh user1@192.x.x.x 'command' but when i am running the script in local server it connecting to the server... (1 Reply)
Discussion started by: ranvijaidba
1 Replies

10. AIX

find the IP's on the sever

Hi , I am working on AIx server which is connected to another network which is a stock market via leased line , From my side I connect to the server locally but what i need is to know the ip whic the server connect to the stock market how I can Know this ???? Thanks (1 Reply)
Discussion started by: habuzahra
1 Replies
Login or Register to Ask a Question