I am using the following drush commands to synchronize development and test environments.

drush rsync @dev @staging 
drush sql-sync @dev @staging

How to setup drush to exclude certain directories (such as sites/all/modules/devel ) from this synchronization process ? I don't want devel module and some other modules to be included in staging environment and would like drush to automatically take care about this requirement.


1 Answer 1


It's not so simple like just don't send the directory.

Actually, you're synchronizing SQL and directories. If you want avoid some directories (specially modules) you should also avoid their tables and configuration sync.

The best way its, from my point of view, to sync them and after to dis and pm-uninstall them in the staging process.

  • Good idea, thank you! I followed your aproach this time and added dis and pm-uninstall into my staging script.
    – LLub
    Commented Sep 19, 2011 at 16:24

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.