Solved

Running a remote script

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to line 1 59
How to redirect a serial com to a KVM machine on Proxmox 3 434
Use Powershell script to ftp 10 119
App holding yum lock unable to update my rpm package 1 72
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

838 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