I have a process that copies files from a main storage server to main other servers. We are attempting to speed up the processing and have thought that the best method would be to use concurrent file copying.
What was suggested is that we change from using a simple RCP and waiting for it to complete, that we append the command with an "&" to have it run in the background and allow the script to keep at maximum 30 processes (RCPs) executing simulatenously.
So we have a loop and we are looping through our RCPs. My questions is this...
How can we capture the return codes from the RCPs that were running in the background? How can we capture the PID that is created?
After all RCPs have completed successfully, we would like to then go back and check on the return codes of each and see that they all ran successfully. We COULD remsh out to each server after the fact to check that the file exists but this too will add to process time.
Any suggestions, comments or answers to my question (PID capture and return code)?