Solved

Running a remote script

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 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

19 Experts available now in Live!

Get 1:1 Help Now