Use drush to sync core &/or modules directory only I've just discovered the wonderful world of drush aliases, and I'd like to use drush to keep a dev site in sync with the live site (and visa versa). So far I've figured out that the following command does it pretty well for a site in the sites/ folder:

drush rsync @mysite.com.live @mysite.com.dev


I'd like to be able to sync modules and core the same way. Is there a way to do that with drush?
To sync contrib:

drush rsync @mysite.com.live:%modules @mysite.com.dev:%modules


%modules will be rewritten to sites/all/modules.

Drush does not have a path alias for the core modules folder, but you could do this:

[REDACTED]


The answer I gave before only sync'ed the core modules folder; what you really want is all of core, minus any sites or contrib modules.  To do that, use the following rsync command:

drush rsync @mysite.com.live @mysite.com.dev --exclude="sites/*"


To sync core and contrib together:

drush rsync @mysite.com.live @mysite.com.dev --include="sites/all" --exclude="sites/*"


Add '-s' prior to the rsync to run in simulated mode (i.e. drush -s rsync ...); if you do this, Drush will print out the rsync command that it would run for those parameters without actually executing it.

Update:

Yes, the rsync command shown in the question will sync the entire Drupal root.  If you want to sync only the sites folder for one particular Drupal site, you could try this:

drush rsync @mysite.com.live:%site @mysite.com.dev:%site


At this point, you might be tempted to chain together all of the commands shown above, and drop it into a script to sync everything that one site needs to run. If that's your intention, you might want to try the following variant, which rsync's everything except the other multisites:

drush --exclude-other-sites rsync @mysite.com.live @mysite.com.dev


Again, run with -s to see what it's going to do with that command.