LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-23-2009, 02:05 PM   #1
senthilmuthiah
Member
 
Registered: Mar 2009
Distribution: Ubuntu, Fedora
Posts: 56

Rep: Reputation: 16
Question Continue Script Execution After Initiating a Program in a Client


All:

I am experimenting to run my simulations with two computers. Every time I run the script on the server, it first checks for the computers' availability (a computer is 'available' if its not executing any simulation currently) and then executes the simulation on that computer.

My script is organized the following way:
if(client is available)
then
ssh into client
run simulation
fi
if(server is available)
then
run simulation
fi

PROBLEM: If the client is available, I want linux to initiate the simulation in the client and then come back and continue executing the remaining of the script [My simulation takes atleast 4 hours to get done. If I am going to wait for that many hours for the control to return to the server, then there is no point in this experiment at all, right?! I want these simulations to run parallely! ]

If anybody could help me in getting the control back to the next line of the script (and hence to check server availability and initiate the simulation in the server), it would be awesome!

Thanks in advance!
 
Old 03-23-2009, 04:35 PM   #2
JaksoDebr
Member
 
Registered: Mar 2009
Distribution: Fedora, Slackware
Posts: 104

Rep: Reputation: 21
In your script you need to add an '&' after the line that takes so long, something like:
./my-application some-params &

the ampersand will make that command run in the background, so the rest of the script will not wait for that line to finish.

Linux Archive

Last edited by JaksoDebr; 04-02-2009 at 04:57 AM.
 
Old 03-23-2009, 07:27 PM   #3
senthilmuthiah
Member
 
Registered: Mar 2009
Distribution: Ubuntu, Fedora
Posts: 56

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by JaksoDebr View Post
In your script you need to add an '&' after the line that takes so long, something like:
./my-application some-params &

the ampersand will make that command run in the background, so the rest of the script will not wait for that line to finish.
Thanks JaksoDebr. I am afraid it isn't working. I tried using 'bg' too. I would greatly appreciate anyother ideas!

Thanks once again!
 
Old 03-25-2009, 06:06 AM   #4
senthilmuthiah
Member
 
Registered: Mar 2009
Distribution: Ubuntu, Fedora
Posts: 56

Original Poster
Rep: Reputation: 16
Alright! I have now got how to do this.
I should execute the commands in the client through "ssh -f".
 
  


Reply

Tags
continue, execution, script



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
how to continue to run a program after logging off ? nkd Linux - Newbie 12 11-28-2008 02:22 PM
WHERE can I find the initiating script for KDE??? piggyaugu Linux - Newbie 4 08-22-2005 04:05 PM
any way to continue using the terminal while any program is being run? g_srinivas Linux - Newbie 6 07-20-2005 08:30 AM
Key bindings program (custom pasting, program execution, etc.) jrdioko Linux - Software 2 02-05-2005 09:09 PM
Starting program remotely and have them continue to run after the session is ended OJAtkinson Linux - General 2 12-07-2004 12:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration