6816 shaares
rsync -r --ignore-existing --include=*/ --include=*.js --exclude=* source/ destination
- -r to recurse into directories,
- --ignore-existing to ignore existing files in destination,
the include and exclude filters mean: include all directories, include all *.js files, exclude the rest; the first include is needed, otherwise the final exclude will also exclude directories before their content is scanned.
Finally, you can add a -P if you want to watch progress, a --list-only if you want to see what it would copy without actually copying, and a -t if you want to preserve the timestamps.