Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 lurking in the Monastery: (11)
As of 2014-09-02 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (32 votes), past polls