I need to rsync a filesystem but only copy a certain file extension

I need to rsync a filesystem but only copy a certain file extension while keeping directory structure

Related tags: Linux

You need to include the file extension you would like (.jpg, or .JPG) in this case and exclude everything else.
The "+ */" makes it recursive.
rsync -avP --include "+ */" --include "+ *.[Jj][Pp][Gg]" --exclude "- *" /path /newpath

Rating: 2

Propose a different solution...