Solved

Running a remote script

Posted on 2004-09-19
3
294 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now