1

Right now I'm successfully running:

rsync -uvma  --include="*/" --include="*.css" --exclude="*" $spec_dir $css_spec_dir

In a shell script which copies all of the files in the source directory, that are .css files, into a target directory.

I want to do the same for HTML files, but only where they are in a subfolder with the name template.

Suppose I'm in directory ~/foo, and I want to rsync where the --include="*/" only matches on subfolders with the name template.

  • ~/foo/bar/template/baz/somefile.html would match
  • ~foo/bar/baz/qux/template/someotherfile.html would match too
  • ~/foo/bar/thirdfile.html would NOT match

So I looked at this question, but they don't quite match what I'm trying to do. The problem is, the list of folders I want to exclude is more than 1 folder--it's, say, 30 folders.

2
  • Please always include your OS. Solutions very often depend on the Operating System being used. Are you using Windows, Linux, Unix, OSX, BSD? Which version?
    – terdon
    Jan 29, 2014 at 22:25
  • Doh! This is OS X Mavericks, BASH-based CLI. Jan 29, 2014 at 23:57

0

You must log in to answer this question.

Browse other questions tagged .