How to rsync only one type of files by extension · Notes

Submitted by michael on Thu, 02/07/2019 - 10:26

Having a file structure full of various file types you want to sync only files of one type into a new location.

rsync -rv --include '*/' --include '*.js' --exclude '*' --prune-empty-dirs Source/ Target/

This will generate the same structure found in Source into Target but only including the JavaScript(.js) files.

I'm tired of looking this up.