I have two directories which I need to rsync the contents of only subdirectories that are already present in the destination directory. For example:
Source directory:
- folder A
- folder B
- folder C
- folder D
- folder E
Destination directory:
- folder B
- folder D
- folder Z
I need to rsync the only contents of folders B and folder D from Source to Destination (and folder Z doesn't exist at source, so should be ignored). Equally, I do not need Destination directory to have folders A, C and E copied to it.
Essentially a "For all subdirectories in Destination, If the same subdirectory exists in source, rsync the contents of that subdirectory from source".
If it helps, these are all local directories.
Hopefully that makes sense. Thank you for the help!
/D/
exists in the destination but not/D/S
, should/D/S/F
be copied?