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!