Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to run the children script exclusively

Status
Not open for further replies.

hokky

Technical User
Nov 9, 2006
170
AU
Hi guys,

Here's part of my script :
Code:
loadData(){
     ...
}

#main program
while true
do
     loadData
     sleep 600
done

But I don't know when the loadData finish, so I don't want my script do another loadData while previous loadData hasn't finished, so the idea is :

a) I want to run another loadData 600 seconds after the loadData finish or ..
b) if loadData takes more than 600 seconds, wait another 600 seconds.

Any idea how to do that guys ??

Thank you very much
 
Hi

That way the [tt]sleep[/tt] will be executed only after the [tt]loadData[/tt] function exits. So no, the [tt]loadData[/tt] function's runs will not overlap.

The problem you described would occur only if [tt]loadData[/tt] is run in background :
Code:
while true
do
     loadData [red][b]&[/b][/red]
     sleep 600
done
Is [tt]loadData[/tt] sent to background ?

Feherke.
 
no, Thanks... I'll try it next week..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top