Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Keep n instances running

by tweetiepooh (Friar)
on Jun 20, 2012 at 14:48 UTC ( #977372=note: print w/ replies, xml ) Need Help??


in reply to Keep n instances running

When ever I need to keep a job running I use a sub shell type structure

#!(bash|ksh|sh) <set up environment> (while true do <perl script> # brief delay to ensure everything is shutdown sleep 60 done) &

The subshell itself is backgrounded rather than just the Perl script.

I'm sure this can be adapted to starting up n copies of <perl script> maybe a little loop that will fire up multiple subshells. Note I'm not a BASH expert

#!(bash|ksh|sh) <set up environment> for I in {1..n}; do (while true do <perl script> $I # brief delay to ensure everything is shutdown sleep 60 done) &; done


Comment on Re: Keep n instances running
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://977372]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2015-07-07 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls