So I have scriptA which does:
ssh server1 -- scriptB &
ssh server2 -- scriptB &
ssh server3 -- scriptB &
wait
otherstuffhappens
ScriptB does:
rsync -av /important/stuff/. remoteserver:/remote/dir/.
rsync -av /not/so/important/stuff/. remoteserver:/remote/dir/. &
exit
My desired result is scriptA will wait for all the instances of scriptB to finish before moving on, which it currently does, however it's also waiting for the background rsyncs of the not so important stuff. These are larger files that I don't want to wait on.
I've read through Difference between nohup, disown and & and tried different combinations, but I'm not getting the result I'm looking for.
At this point I'm pretty stumped. Any help would be appreciated!
wait
entirely. Though I'm guessing what the OP meant to do was run bothrsync
processes in parallel, which would mean backgrounding them both (with&
) and then usingwait
. In any case, I agree that this is the most straightforward way to fix the issue and is the one I'd choose based on the information in the question. – David Z Jul 28 '17 at 03:31