Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Spawn Process, Is it possible to have a korn shell script spawn multiple processes
demanaz
post Nov 28 2008, 03:41 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 6
Joined: 28-November 08
Member No.: 13,769



Hi all:

I'm writing a korn shell script that runs on one box and connects to multiple (100+) boxes:

################ SCRIPT: ########################
#!/bin/ksh

for srv in `cat server_list|grep -v '#'`
do
echo "starting $srv"
ssh $srv "./extract_script"
scp $srv:/scripts/extract_script_output extract_script_output_$srv
echo "finished $srv"
done

################ SCRIPT: ########################

(the actual script does a lot more, but this is the basic idea)

Is it possible in ksh to spawn the for loop statements into other processes so i can be running the commands on all the servers at the same time w/o having to wait for each server to finish?

I could schedule the extract_script to run on each server individually, but then i have to maintain 100+ versions/schedules. This would be the easiest way for maintaince...

thx in advance
Go to the top of the page
 
+Quote Post

Posts in this topic
- demanaz   Spawn Process   Nov 28 2008, 03:41 PM
- - docmur   Sure you can just take a look at forking the proce...   Dec 2 2008, 06:59 AM
- - demanaz   QUOTE (docmur @ Dec 2 2008, 05:59 AM) Sur...   Dec 4 2008, 10:15 AM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 12th December 2017 - 10:29 PM