1

I'm currently using rsync to backup my development drive. In it I have many projects with a node_modules directory. This can happen recursively in any part of the tree. I'm trying to get rsync to exclude this dir completely no matter where it appears in the tree except that I'm only being able to exclude it in the top most branch.

I thought that by using a glob pattern in the exclude flag I would be able to achieve this but I'm not being able to.

EDIT: Here's the command I'm using:

rsync -avrt --no-whole-file --inplace --delete --exclude-from ~/backup_scripts/exclude_list . /Volumes/Backups

The file ~/backup_scripts/exclude_list contains:

Library/Application Support/Spotify/PersistentCache/Storage/
Library/Application Support/Steam/appcache/httpcache/
Library/Application Support/Steam/config/htmlcache/
Library/Caches/
Library/Logs/
.bash_sessions/
.npm/
.composer/
.pdepend/
.cocoapods/
node_modules

Also tried */node_modules and node_modules/* to no avail.

  • 3
    What's the actual command you're using? – muru Jun 4 at 3:51
  • @muru I've updated the answer with an example. – poisa Jun 5 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.