I have searched for hours: scouring these forums, documentation on Drupal.org, and various searches on google for third-party web sites with Drupal tips. I have found enough documentation to install Drush and get it to run (sort of). But I also had to "hack" it: the readme instructions were not adequate, many of the tutorials contradicted each other and the readme (including the official documentation and issue posts), and in general it's been very frustrating.

Does anyone know of a good set of tutorials or documentation on Drush? I will be using it on a CentOS VPS which has a multi-site installation on one IP and a single domain with sub-domains on the other IP. It's not even clear to me that a single Drush installation can be used. I admit I am not skilled with Linux at the command level, but I paid my dues at the DOS prompt writing batch files for years, so I think I can learn what I need to.

Any pointers, links to tutorials or links to other Drush documentation will be greatly appreciated.

Comments

yelvington’s picture

Drush on a multisite installation (and sometimes on a single-site installation) will make you crazy if you don't do this:

drush --uri=http://example.com command

Always make sure you're in the docroot before you run a command.

And keep in mind that you're going to get hollered at because you're not running under the webserver's UID. Any operations that attempt to change files owned by the server -- for example, flushing and rebuilding aggregated CSS and Javascript, or clearing a Boost cache -- will fail. Usually this is not important.

I use Drush a lot to update modules, and it's a real timesaver.

If you update modules on a multisite installation, don't forget to update the other sites running on the same file tree. Drush should notice that update.php hasn't been run, and take care of it for you.

wb54321’s picture

@yelvington: thank you very much!

Sorry for being such a command-line noob:

I assume "drush --uri=http://example.com command" starts drush and performs whatever command (IE update or up). The latest Drush help listing says this: "-l , --uri=http://example.com URI of the drupal site to use (only needed in multisite environments)". It's more than a bit confusing: drush help seems to be telling me I can use -l instead of --uri, and the whole "-" vs "--" is not making sense to me.

Help also states the --uri is only needed for multisite, but does it still work if one has a VPS with multiple accounts on the server? I use one account for a multisite installation and another dedicated to a single domain. I am also confused on just where to install the Drush files; the readme says "a folder outside of your web site" and adds "if drush is in your home directory", which could be interpreted as being "a folder inside of your web site". Maybe I am over-thinking things and they simply mean "don't install Drush where updating or uninstalling might overwrite your drush files". I would prefer a single drush folder for both accounts, but I will be happy just to get drush running even if I have to install two drush folders.

I am also a bit hazy on how Drush works regarding subdomains. Do I just use this?:
drush --uri=http://subdomainname.example.com command
That seems the most logical way to me, but what seems logical is often wrong.

vj_pdx’s picture

This isn't a unified document, but perhaps this will answer some questions.

Start with Lin Clark's screencast on D7 and installing Drush.
Here's another screencast with more detail on the whys and wherefores -- it also has some resources at the bottom.
If you're feeling rusty about command line interfaces, check out the Lullabot (free) videos from 2010.
Fun with site aliases in Drush 3.0.
Explanations of commands in Drush.

If this doesn't do it, there are many more documentation files on Drush -- perhaps one is right for you?

TribalMan’s picture

Would it be
drush --uri=http://localhost:8888/sitename command

I tried different permutation of that and kept getting a "The drush command 'command' could not be found." error