Drush rsync and drupal composer wrong destination dir I'm trying to sync two D8 sites. Both set up with drupal composer which means that the directory structure is a bit different than usual. Composer puts drupal files inside web sub directory like this:

/var/www/drupal8
|-- composer.json
|-- composer.lock
|-- drush
|-- scripts
|-- vendor
`-- web
    |-- autoload.php
    |-- core
    |-- index.php
    |-- modules
    |-- profiles
    |-- robots.txt
    |-- sites
    |-- themes
    |-- update.php
    `-- web.config


My aliases file looks like this:

&lt;?php

$aliases["local"] = array (
  'root' =&gt; '/var/www/drupal8/web/',
  'uri' =&gt; 'http://local.site',
);

$aliases["remote"] = array (
  'root' =&gt; '/var/www/drupal8/web/',
  'uri' =&gt; 'http://site.example.com',
  'remote-user' =&gt; 'dev',
  'remote-host' =&gt; 'site.example.com',
);


When I do drush rsync @remote @local I end up with all files from @remote/web inside @local/web/web like this:

/var/www/drupal8
|-- composer.json
|-- composer.lock
|-- drush
|-- scripts
|-- vendor
`-- web
    |-- autoload.php
    |-- core
    |-- index.php
    |-- modules
    |-- profiles
    |-- robots.txt
    |-- sites
    |-- themes
    |-- update.php
    |-- web
        |-- autoload.php
        |-- core
        |-- index.php
        |-- modules
        |-- profiles
        |-- robots.txt
        |-- sites
        |-- themes
        |-- update.php
        `-- web.config
    `-- web.config


I can't edit aliases to remove web sub dir from root path because then drush will not work as it will complain that it needs a higher bootstrap level to run (because it won't know where is drupal root folder).

How can I instruct drush to use proper destination path for synchronisation?
I had the same problem took me ages to find out what was wrong.
Turned out to be the slash (/) behind the root folder that was missing.

self.site.yml


remote:
  host: domain.com
  user: user
  root: /home/user/public_html/
  uri: http://domain.com


@see https://unix.stackexchange.com/questions/402555/why-add-a-trailing-slash-after-an-rsync-destination

Turned out to be a bug in drush
https://github.com/drush-ops/drush/pull/3405