1

I am using drush on ubuntu 14.04. I have more than 20 site on my localhost /var/www with virtualHost setting. I have a question that whenever i go to /var/www/site1 and run drush dl module_name. It download the module in sites/all/modules directory in site1 folder. Now i cd to /var/www/site2 and run drush dl module_name. It will again download the module in site2 module directory.

In every site i have to do drush dl for same module. Is there any method so that i don't need to do drush dl every time. I just do drush dl module, it will check from all other sites for particular module, if not found then will download from internet. I already doing cp and scp for same module. But i want to do with drush. I am very greedy to save my internet bandwidth.

Thanks in Advance.

1

you can use:

drush dl modulename --cache

From drush help dl:

Download Drupal core or projects from drupal.org (Drupal core, modules, themes or profiles) and other sources. It will automatically figure out which project version you want based on its recommended release,
or you may specify a particular version.

...

Examples:

 drush dl webform --cache                  Download webform. Fetch and populate the download cache as needed.

Options:
 --cache                                   Cache release XML and tarballs or git clones. Git clones use git's --reference option.                                                                         
   --cache-duration-releasexml             Expire duration (in seconds) for release XML. Defaults to 86400 (24 hours).
...
0

What you could do is a "common" directory with a link to the parent site.

So will be /var/ww/site1/sites/all/modules/common (the parent)

then: ln -sv /var/www/site1/sites/all/modules/common /var/www/site2/sites/all/modules/common

With this you only do one 'drush dl module_name' for commons modules.

Other way to manage if you don't want to create links in folders you could use the drush aliases.

Create a file in you .drush directory ~/.drush/aliases.drushrc.php

Then you will be able to do this things

drush @dev1,@dev2 dl modulename drush @dev1,@dev2 cc all drush @dev1,@dev2 updb

Hope some of this tips help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.