I am a bit lost. Because here no commands are working recursively.
When I type "/dir/*.txt" on the command line it will include all files within that directory only, not recursively (e.g. rsync /dir/0.txt /dir/1.txt /dir/2.txt /dest). And the program is not going to check recursively as well because there is no folder given as option!?
And I think the OP wants other thing. Or no!?
EDIT:
I think the OP wanted something that would work like this instead!?
Code:
find . -type f -name "*.txt" -exec cp -u --parents {} /example/destination \;
Note: You have to execute this where the root of your "*.txt" files are to work as intended (e.g. ./copy.sh).
That worked like this:
Source: All "*.txt" from a folder and its sub folders.
Destination: Another folder on another disk with the exact same directory structure but only those with ".txt" files.
I guess that was what the OP intended. Still not sure.