In my local environment, I don't want to copy uploaded files like pdfs, mp3s, etc but I do want uploaded jpgs so nodes with images will not show broken images after grabbing the remote database. I'd like to build a list of patterns that are excluded in my drush aliases to save time from transferring undesired files. My previously posted issue shows how I was able to include a list of patterns via rsync --exclude-from=/path/to/file, but I wanted to use that on a server alias and then have site-specific excludes in another alias, I would only be able to pass one of them through drush.
The help pages for drush core-rsync state that --RSYNC-FLAGs will be passed onto drush's command, but if you use multiple --excludes only the last one is used.
$ drush -v rsync --exclude=".htaccess" --exclude="*.pdf" @proj-trunk:%files @proj-local:%files
...snip...
Do you really want to continue? (y/n): y
Calling system(rsync -e 'ssh ' -CrlptDzv --exclude="*.svn*" --stats --progress --exclude='*.pdf' alan@devsrv:/var/www/vhosts/project/sites/default/files/ /Users/alan/Sites/project/sites/default/files)
...snip...
Command dispatch completeThis is because of the way rsync flags are whitelisted in rsync.core.inc, right?
Comments
Comment #1
greg.1.anderson commentedNo, this limitation is due to the way that drush itself takes all flags and puts them into an associative array; all of the --exclude options go into the same key, which causes them to overwrite each other (last one in wins).
Use --exclude-paths to exclude from multiple paths.
Comment #2
alanthing commentedThanks, Greg.
Comment #3
alanthing commentedIt took me a while to figure this out, but the --help documentation is wrong. --exclude-paths doesn't do anything, it's --exclude-path; as described here: http://drupal.org/node/842042 . I'm disappointed it can't be fixed in the 3.x branch because it's pretty confusing.