In my bash shell script, I wanted to fetch data in parallel from remote machines so I used a &
in between the commands
Since my path was configured at runtime I first used a variable (String by default ) as such,
variable1="rsync -a /path/to/${runtime_parameter}_01/abc/xyz.txt"
variable2="rsync -a /path/to/${runtime_parameter}_02/def/ghi.txt"
variable3="rsync -a /path/to/${runtime_parameter}_02/mno/jkl.txt"
Then I execute them as follows,
`$variable1` & `$variable2` & `$variable3`
When using a single rsync
I make a check verifying if $?
i.e. exit status is equal to 0
for success.
My script should not proceed unless the rsync
process is complete. How do I verify if the process are completed?