LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-21-2009, 01:35 PM   #1
s_linux
Member
 
Registered: Jul 2009
Posts: 80

Rep: Reputation: 15
How to run same script on multiples servers


Hi All,
I have some script that run some commands and send results to my email. I want to run same script on mulitiple servers. How can I do that. I know there is an option "ssh". But I'm not quite sure how to use it in the script.

And also. scripts has some parameters like following,

if [ -f "/some/some/some1"]: then

do something.

"/some/some/some1" will vary by the server.

Any body have an idea. Thanks
 
Old 07-21-2009, 02:52 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
the way to use ssh is to run "ssh user@host myscript" which will then run "myscript" on the remote server. This method would only work if you're using preshared SSH keys to remove the need for passwords with ssh. and you want to pass a parameter to the script? fine, just add it on to the command line.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the easiest way to run a shell script in the background on 10 servers? abefroman Linux - Software 3 03-12-2008 09:24 AM
how to connect to multiples AP darkangel29 Linux - Wireless Networking 5 03-04-2007 07:16 AM
Run 2 different X servers Tarrasque Linux - Software 11 01-10-2006 12:09 PM
Installing multiples linux OS pas Linux - Newbie 5 06-02-2005 11:27 PM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM


All times are GMT -5. The time now is 03:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration