I've seen many exclude path examples here on stack exchange. But I can't figure out the way to make it work.

To keep it simple :

We have two aliases @self and @live

we have a theme called themename in /sites/all/themes/themename

in the theme folder we have a subdirectory called node_modules because of the use of gulp in our development workflow.

How can we make sure to exclude /sites/all/thems/themename/node_modules/ when syncing with drush rsync @self @live ?

  • What command what you tried already and what went wrong?
    – kenorb
    Commented Oct 21, 2015 at 10:55

1 Answer 1


drush rsync has an --exclude-paths parameter that will allow you to exclude your node_modules directory.

Have a look at the parameters for rsync.

You should be able to do something like :

drush --exclude-paths=sites/all/themes/themename/node_modules rsync @self @live 

Because the Drush rsync command uses strict option handling, the --exclude-paths option must appear before the rsync command name.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.