Ksh script help
2007-12-25 3:37:00
I'm trying to write a script that can start up to a certain number of
instances of the same command(a backup cloning job) based on a given
num_command_limit that it gets from an external file. As this script
runs through a list of possibly 20 volumes or more I want to keep, for
example, 3 cloning processes running at all times until they are all
complete. My question is how do I start a background process and still
capture the exit code? I can't use 'wait', because the script is
continually looping to see if it can start another clone. My current
idea is that I would have each clone job write a single line to a
"status" file when it completes. Then I would have a loop in my main
script(after it started the final clone job) that would check that
"status" file every few minutes until it is x number of lines long.
This is definitely a hack, but I can't think of a better way to achieve
what I'm trying to do. Anyone have any suggestions? Is there another
scripting language that would handle this task better?
Thanks in Advance!
Joel
Comments
Got something to say?
You must be logged in to post a comment.

