how to run multiple process at the same time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to run multiple process at the same time
# 1  
Old 06-24-2008
Error how to run multiple process at the same time

Hello guys,

Look what im doing:

I need to run a process from a SERVER1 to SERVER2, SERVER3 and SERVER4.

The shell of the process is in each SERVER (2 to 4)

So from SERVER1 i do:

Code:
for i in SERVER2 SERVER3 SERVER4
do
rsh $i '
./process.sh
'
done

The problem is: each process.sh takes around 30 minutes so i have to wait 90 minutes to take the final result, my question is, how i can run the process.sh in the SERVER2, SERVER3 and SERVER4 at the same time? and i have to wait only 30 minutes?
# 2  
Old 06-24-2008
Add the -n option to rsh redirect its stdout to a file or /dev/null and put it in the background.

Code:
for i in SERVER2 SERVER3 SERVER4
do
    rsh $i -n '/path/on/remote/server/to/process.sh' > /dev/null &
done

# 3  
Old 06-24-2008
Thanx that really works
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

To run 5 commands at the same time with process from a list

I have many command is list in the variable lists,each command will run a very long time, so I want to run 5 commands at the same time with process till it complete run all the command, lists="aa bb cc dd xx gg blabla zz ......." ( a very long list) can some one point me the codes? ... (7 Replies)
Discussion started by: yanglei_fage
7 Replies

2. Shell Programming and Scripting

Passing multiple run time arguments

the scenario is - If I pass 3 three arguments( run time) , it should list all .txt files from a path to temp file if I pass 2 arguments ( run time) , it should list all .csv files from the same path to another temp file the above scenario should be handled in single code and also I dont know ... (2 Replies)
Discussion started by: Prashanth B
2 Replies

3. Shell Programming and Scripting

Accepting multiple values in a variable at run time

Hi, Below is starting entry of my script #!/bin/ksh Usage() { print "Usage: $0 ID OPTION SERVER" print "<br>Where :" print "<br>Enter your ID into PARAM1, OPTION in the PARAM2 and SERVER in the PARAM3 field" print "<br>ID should be a valid ID" print "<br>OPTION should be either... (2 Replies)
Discussion started by: gopajitmalakar
2 Replies

4. Ubuntu

run multiple command at the same time in one window terminal using multiplexer

Hi, I would like to ask if someone knows or accomplished this task in the terminal multiplexer in a single window with multiple splitted pane: In the script run multiple command at the same time in diff splitted pane or simulatneously. As an example: I would like to run iptraf, iotop, htop,... (2 Replies)
Discussion started by: jao_madn
2 Replies

5. Shell Programming and Scripting

Multiple process write to same log file at the same time

If we have 3 process to write to same log file at the same time like below. will it cause the data outdated because the multiple process writing same time? It this a safe way to keep the log for multiple process? p1 >> test.log &; p2 >> test.log &; p3 >> test.log & Thanks, (5 Replies)
Discussion started by: casttree
5 Replies

6. Shell Programming and Scripting

script to monitor the process system when a process from user takes longer than 15 min run.

get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same. hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies

7. UNIX for Dummies Questions & Answers

Run process with nohup every certain time

Hi, I need execute a script every 30 minutes. As might be done without using cron Thx. (6 Replies)
Discussion started by: pepeli30
6 Replies

8. Programming

kill a process which run out of time

hello everybody!! i want ur help! it is urgent!! ... pid=fork(); if(pid==0) { execl(a program); exit(1);} else if (pid>0) { timer(5); //(command 1)timer is a function that count up to 5sec if(kill(pid,0)==0)kill(pid,9);//(command 2) wait(&status); .... } else perror("error");... (3 Replies)
Discussion started by: nicos
3 Replies

9. Shell Programming and Scripting

how to run process in certain date and time

hi all! i want to run a process in certain date and hour (like feb 2007 ,hour 3 p.m) how shell i write it my script call cs-update-pr another question :as the script running, will i see it as process ?ho does it run background? and if not - how can i define to him to run background? thanks... (3 Replies)
Discussion started by: naamas03
3 Replies

10. Programming

Process Run time information

Hello, I am working on Sun Solaris 5.7. I am trying to read the running time of a process through a C program. One way I am reading it is by using the command ps -<pid> -f The other way is from the struct psinfo_t which is there under /proc/pid/psinfo. However, the two times are... (1 Reply)
Discussion started by: hmurali
1 Replies
Login or Register to Ask a Question