1

I have the following alias group set in the setA.aliases.drushrc.php:

  $aliases[‘site1'] = array(
      'root' => '/var/www/site1',
      'uri' => '88.88.88.11/site1',
      'remote-host' => '88.88.88.11'
  );

  $aliases[‘site2’] = array(
      'root' => '/var/www/site2',
      'uri' => ‘88.88.88.22/site2',
      'remote-host' => '88.88.88.22'
  );

  $aliases[‘site3’] = array(
      'root' => '/var/www/site3',
      'uri' => ‘88.88.88.33/site3',
      'remote-host' => '88.88.88.33'
  );

Now, I have updated @site1, and would like to sync with other sites in setA alias group, can I just use the following command "drush rsync @site1 @setA"?

Or how can I exclude @site1 from destination @setA as it is actually the source?

1 Answer 1

0

In Drush 6 and earlier, the rsync command did make some attempt to operate on site alias lists; however, we recently decided that this feature was not useful enough to continue to maintain it, so we removed it from Drush 7. Truthfully, I'm not even sure that it's working right in Drush 6 -- casual tests showed inconsistent results.

Therefore, the best way to do this would be to just call drush rsync once for every destination site. You could do this with a simple script.

#!bin/bash
for site in $(drush sa @setA --format=csv --fields=name)
do 
    if [ "$site" != "site1" ]
    then 
        drush --yes rsync @site1 "@$site"
    fi 
done
3
  • That would be a bad news to me. Is there any way I can do it by batch as I have many similar sites. Call drush rsyn once for every destination site would be time consuming and easy to miss a site.
    – leekit
    Commented Nov 20, 2014 at 8:57
  • Updated answer. Commented Nov 20, 2014 at 15:08
  • If you found the answer helpful, don't forget to click to accept it. Welcome to the group! Commented Nov 28, 2014 at 7:08

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.