Pages

Friday, December 10, 2010

Drupal: Add a Command-line Interface with the Drush Module

The Drush module for Drupal allows you to have a command-line interface and a scripting environment for your Drupal website if you are accustomed to using the command prompt (mostly available to dedicated and virtual private servers). drush means Drupal Shell.


I tried out this module because I am looking for faster alternatives to some trivial queries in Drupal and that won't require me to browse through all the admin pages just to get those done. For example, if I want to clear the site cache, by default I had to hover over the top left favicon in the Admin menu and click Flush Cache. With Drush it is made easy with the command ./drush clear-cache. And also, less prone to site loading delays and errors. Plus, it shows up debugging messages which is a really great help to developers.

Another use of drush is to avoid scheduling the default cron.php but rather use the specific command ./drush cron to run cron at the background since this will use lesser resources.

I highly recommend all Drupal admins to include drush into their sites for easy scripting and site maintenance.

Project page: http://drupal.org/project/drush
Documentation: http://drush.ws/

No comments:

Post a Comment