I cannot manage to use the following alias settings for the core-rsync command:
- source-command-specific
- target-command-specific
This is even more surprising because they are explicitly described in "drush topic docs-aliases".
After digging into the code, it seems that these prefixes are simply not handled by the rsync command (I tried to compare with sql-sync that works correctly).
You can try the following configuration:
$aliases['src'] = array(
'uri' => 'default',
'root' => '/path/to/src',
'source-command-specific' => array (
'core-rsync' => array (
'delete' => true,
'exclude-paths' => '.htaccess',
),
),
);
$aliases['dst'] = array(
'uri' => 'default',
'root' => '/path/to/dst',
);
The command drush rsync @src @dst -s doesn't take into account the --delete option.
If you replace the source-command-specific option by command-specific, it works as expected.
Comments
Comment #1
mdhooge commentedThe problem is also present in 4.1 & 4.2.
Comment #2
greg.1.anderson commentedYes, this is a good idea.
Comment #3
mdhooge commentedHello Greg,
I don't mind that you recategorized my bug report as a feature request. But since this feature is already explicitly mentioned at line #173 of example.aliases.drushrc.php, I thought it should be available ;-)
However, even without that feature, I couldn't live any longer without rsync & aliases!
Comment #4
greg.1.anderson commentedBug or a feature, that is the question. Either way, I agree it is important and will try to find time to implement it soon. My comment in example.aliases.drushrc.php was clearly overly optimistic, because I never the code to go with (half of) it. :) Oops!
Comment #5
drew reece commentedYou can use just 'command-specific' options to get the values applied for using rsync as a workaround at the moment. Probably less than ideal depending on your setup.
The site-alias command is also stripping the 'command-specific' records from a local alias, I wonder if it is related. I'm using drush 4.2.
drush sa @myaliaswill only show the source-command-specific or target-command-specific entries. I have both core-rsync & sql-sync settings in the xx-command-specific sections.Comment #6
willieseabrook commentedI just read the docs, tried to use this feature, found out its not actually implemented yet, and found this issue.
Would be a great addition!
Subscribing.
Oh and is this *really* 5.x-dev?
Comment #7
greg.1.anderson commentedVersion 5.x-dev means that this will be fixed in the master branch first; once fixed, it will become 'patch to be ported' on version 4.x-dev.
Comment #8
greg.1.anderson commentedShould fix for drush-5.
Comment #9
firebus commentedthe documentation also states that
this also does not seem to be the case - command-specific options in a source take precedence over those in a destination alias in my experience
Comment #10
greg.1.anderson commented'source-command-specific' and 'target-command-specific' are now broken for sql-sync as well as core-rsync.
Comment #11
greg.1.anderson commentedFixed source- and target-command-specific for sql-sync, implemented it for core-rsync, fixed ordering problem mentioned in #9, and also fixed #1418230: command-specific array in $aliases isn't doing anything.
Comment #13
wim leersI suppose this won't be backported to 4.x then, as mentioned in #7?
Comment #14
greg.1.anderson commentedThis is a candidate for back-porting. I don't know if it will go in or not, but I should have set it patch to be ported instead of 'fixed'.
Comment #15
greg.1.anderson commentedWith Drush-5 about to be released, this seems more like a nice-to-have than a must-have.
Comment #16
firebus commentedif the bug isn't going to be fixed, we should at the very least update the documentation. do we need a separate issue for the docs fix?
Comment #17
greg.1.anderson commentedThe next step would be for someone to submit a patch (code or docs)
Comment #18
msonnabaum commentedIf someone wants to post a 4.x patch I'll backport it, but since 5 is already out I won't be working on it.
Comment #19
moshe weitzman commented