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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.