UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 5th, 2004, 06:39 PM
peacenpotatoes peacenpotatoes is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 peacenpotatoes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
rsh to several servers in script doesnt work

HEy EveryOne,

I'm not really a "Scripter" Im a mere admin looking to MAke mY job Easier. We have about 15 Servers in our system. We have to log onto each server 5 times daily and run 2 simple commands; mount and df. Its really simple. I want to incorporate these silly commands into a script so we dont have to log on to each machine individually....then possibly create a cron job.

Here's what i'm trying to do....

#!/bin/ksh
#
#
rsh server1
echo you are now on server1
df -k
sleep 3
mount -p
sleep 3
exit
rsh server2
echo you are now on server2
df -k
sleep 3
mount -p
sleep 3
exit
and so on and so forth....

But what happens is - Ill run the script and it will rsh to the server but it wont execute the commands until i type exit from the server i Remote Shelled into. I dont know what to do from here. I came here because i heard this is the forum where all the really smart people hang out. Can a really smart person help me out?

Thanks!

Appreciate your help.


Reply With Quote
  #2  
Old October 6th, 2004, 02:08 AM
Muthukumar_K Muthukumar_K is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 13 Muthukumar_K User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Muthukumar_K
IF you are trying to manage with multiple servers then the control must be there with the executing server only.

server -----> server1
-----> servern

So simply as,


rsh server1 "df -k;mount -p"

It will give results there without login into the system.

REgards
Muthu

Reply With Quote
  #3  
Old October 6th, 2004, 12:49 PM
peacenpotatoes peacenpotatoes is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 peacenpotatoes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

Thanks Muthu! I'll let you know how it works....

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > rsh to several servers in script doesnt work


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway