Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Running a remote script

Posted on 2004-09-19
3
Medium Priority
?
305 Views
Last Modified: 2010-04-21
Experts,

            Currently I run about 25 scripts per day to perform various tasks on various linux servers. I am looking for a program that will remotly run scripts for me. Basicly all it needs to do is store a script, connect to SSH, run the script and exit. Your help is much appreciated. Thank you.
0
Comment
Question by:capacity
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 750 total points
ID: 12097957
If you pre-configure the servers for a public/private key exchange, so you don't have to enter a password this gets really simple. And it gets even simpler if you install your scripts on the server, say in /usr/local/sbin. All that's necessary then is a script that uses ssh to run the script on the remotes, something like:

#!/bin/sh
#
# Execute Scripts on server1
#
ssh remote-user@server1.dom.tld /usr/local/sbin/script1
ssh remote-user@server1.dom.tld /usr/local/sbin/script2
#
# Execute Scripts on server2
#
ssh remote-user@server2.dom.tld /usr/local/sbin/script1
ssh remote-user@server2.dom.tld /usr/local/sbin/script2
0
 

Author Comment

by:capacity
ID: 12098162
Thank you for your commends, however, I am looking for a name or a link to an actual program. We have previously established scripts and put them on the servers, now all that is left is the program that will go and execute them.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12099298
The program for executing the scripts will be ssh, as I showed above. If you need to execute a number of scripts on the servers, one after the other you could use a wrapper script that you install on the server that will execute each script in turn. Or run ssh from a local script like I described.

Maybe I don't fully understand your problem. What is it about what I've described that is a problem?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question