The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Adding options to a shell script paulobrad Shell Programming and Scripting 1 07-15-2008 09:58 AM
pwd & cd commands not working in shell script perk_bud Shell Programming and Scripting 9 04-07-2008 07:11 AM
shell script to run a few commands help! perk_bud Shell Programming and Scripting 23 07-06-2007 03:34 AM
how to sql commands in shell script balireddy_77 Shell Programming and Scripting 1 11-15-2006 02:00 PM
How to run unix commands in a new shell inside a shell script? hkapil Shell Programming and Scripting 2 01-04-2006 06:56 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 4.00 average. Display Modes
  #1 (permalink)  
Old 07-16-2008
Moxy Moxy is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 14
Adding ssh commands to a shell script

I have written some scripts that do a few admin tasks on 23 servers I manage.
Usually I execute these scripts from one server by running ssh commands remotley, i.e.
ssh root@server2 shellscript, ssh root@server2 shellscript & so on..

It works fine but I want to improve this by writing a script on my main server to run all the scripts on the other 23 servers.

Opinions on whether this is a good idea or not would be great & advice on how to implement it effectively would be great.
  #2 (permalink)  
Old 07-16-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
While I see where your going with this, IMHO I would not. I would run the commands separately, if you messup 1 server with a bad script its eaiser to fix then running one command and killing all 23 or however many.

if you want to do it I would guess one way would be to create an array with all the servernames. then do a for each server in the array and call the commands/script.
  #3 (permalink)  
Old 07-16-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
In the past I had somethign similar for updating linux workstations. I had a script on the remote workstations run a cron script that checked for an update on a web server. If it was "true" it would wget the script and run it. So there were no actual ssh'ing. The cron would run everyhour or how ever long you wanted.
  #4 (permalink)  
Old 07-17-2008
Moxy Moxy is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 14
Thanks for your input Ikon, you've given me some useful feedback, appreciate it.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0