LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-09-2004, 10:18 AM   #1
podollb
Member
 
Registered: Oct 2003
Location: Grand Forks, ND
Distribution: Suse/Slackware/RH
Posts: 161

Rep: Reputation: 30
rsh script to run on cluster


If I have a cluster that is secure from the net and I have rsh running on all of them so I can easily communicate with no overhead, how can I write ONE script that can be run and it will dispatch all machines to start a process? My first thought was just a shell script that rsh'd to all the nodes and ran something but after the script rsh's to the first node the script loses control, any idea? For the sake of argument lets say I want to execute an arbirary script or executable that all the nodes have access to via NFS...
 
Old 03-10-2004, 09:55 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,287

Rep: Reputation: 173Reputation: 173
doesn't something like this work:

==============
for machine in <list-of-machines>;do

rsh $machine <script> &

done
===================



or am i being stupid?

regards, billy
 
Old 03-10-2004, 10:04 AM   #3
podollb
Member
 
Registered: Oct 2003
Location: Grand Forks, ND
Distribution: Suse/Slackware/RH
Posts: 161

Original Poster
Rep: Reputation: 30
That looks like it should, thanks.
 
Old 03-10-2004, 10:22 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,287

Rep: Reputation: 173Reputation: 173
Ideally you'd probably want to batch them, so you get a mail with the output from each, and maybe pass script as a parameter?
so instead probably better is

================
#!/bin/bash

script=<SCRIPT_NAME> # script name OR
script=$1 # passed as parameter

for machine in <LIST>;do

batch <<EOF

/bin/rsh $machine $script
EOF

done
===================
(if batch doesn't work use 'at now' )


then you will get an email for each invocation on each machine
easier to catch errors!


regards, billy
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error while trying to run exec method with rsh as arguement nedian123 Programming 0 12-18-2004 12:07 AM
Run a command across a cluster podollb Linux - Software 3 05-21-2004 08:55 AM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM
rsh on Cluster nodes rudy3107 Linux - Software 0 07-22-2003 06:53 AM
rsh between 2 nodes on a Linux Cluster marxsmann Linux - General 2 01-26-2003 04:15 PM


All times are GMT -5. The time now is 09:09 PM.

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