An Introduction To DrushSteven C JacksonRoger Soper
OS SolutionsOS Solutions began in early 2009 as a one-stop computer shopEvolved to be Drupal Consultants and Software EngineersSeveral years of Drupal experience and nearly a decade of PHP experienceAll solutions are open-source
VitaeSteven C JacksonBachelor’s Computer ScienceFinalizing Master’s Computer ScienceRed Hat Certified TechnicianFree Software Foundation ContributorWrote BASH.ED (CC licensed, also free in PDF format)Linux Nerd
What is Drush?Command Line UtilityDRUpalSHellAs defined:drush is a command line shell and Unix scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.
Why Use Drush?Great for sysadminsEasy commandsWritten in PHP  Easily extendableOne installation to rule them allCan even use on Windows OSSaves Time
How To Get?Download from Drupal.orghttp://drupal.org/project/drushInstallation is super easy for sysadmins and the average code monkeyhttp://ossolutions.org/article/install-drush-server-you-dont-have-admin-rights-0
Install OverviewDownload drush [ wget http://ftp.drupal.org/files/projects/drush-All-versions-3.0-beta1.tar.gz ]Extract it [ tar xzvfdrush-All-versions-3.0-beta1.tar.gz ]Make it executable [ chmodu+xdrush ]Alias or PATH it [ alias drush=‘/path/to/drush’ ]Source or Export [ source ~/.bashrc ]
How to UseNavigate to your site root (or further)cd /var/www/mysiteNote: Drush reads sites/default/settings.php for db infoType ‘drush’ to get a list of commands
Common CommandsdlDownloads a module or themeExtracts itExampledrush dl node_pagedrush dl zen
Common CommandsenEnables a module or themeExampledrush en node_pagedrush en zen
Common CommandsccClears Drupal CacheExampledrush ccGives you a choice to clear individual cache or all cache
Common Commandssql-dumpPerforms a mysqldumpExampledrushsql-dumpDon’t forget to redirect your output lest you have it all print to screenDrushsql-dump > out.sql
Common Commandswatchdog-listView the watchdog logs basaed on severity levelsExampledrush watchdog-list
Common CommandsRemember there are a plethora of commands at your disposalJust type ‘drush’ at the command line for a list of available optionsBecause drush is extendable some modules or profiles (like Aegir) offer additional functionality
Drush MakeExtremely power Drush utilityAllows you to wrap up and entire site in a make file and deploy the site basically as a profileBeyond scope of Intro to Drush but worth checking outhttp://drupal.org/project/drush_make
Try It Yourselfssh adug@173.203.103.240Password: adug!Site path: /var/www/adug/URL: http://173.203.103.240/Site un/pw: admin/adug!Temporary server but please don’t go crazy 
Topic Suggestions?Meetings 2nd Saturday of every month at 2pmAlways at OS Solutions1244-B Jones St, Augusta, GA 30901steven@ossolutions.orgroger@ossolutions.org888-275-4893Videos and Slides available online @ ossolutions.org and slideshare.net/ossolutions

Intro to Drush

  • 1.
    An Introduction ToDrushSteven C JacksonRoger Soper
  • 2.
    OS SolutionsOS Solutionsbegan in early 2009 as a one-stop computer shopEvolved to be Drupal Consultants and Software EngineersSeveral years of Drupal experience and nearly a decade of PHP experienceAll solutions are open-source
  • 3.
    VitaeSteven C JacksonBachelor’sComputer ScienceFinalizing Master’s Computer ScienceRed Hat Certified TechnicianFree Software Foundation ContributorWrote BASH.ED (CC licensed, also free in PDF format)Linux Nerd
  • 4.
    What is Drush?CommandLine UtilityDRUpalSHellAs defined:drush is a command line shell and Unix scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.
  • 5.
    Why Use Drush?Greatfor sysadminsEasy commandsWritten in PHP  Easily extendableOne installation to rule them allCan even use on Windows OSSaves Time
  • 6.
    How To Get?Downloadfrom Drupal.orghttp://drupal.org/project/drushInstallation is super easy for sysadmins and the average code monkeyhttp://ossolutions.org/article/install-drush-server-you-dont-have-admin-rights-0
  • 7.
    Install OverviewDownload drush[ wget http://ftp.drupal.org/files/projects/drush-All-versions-3.0-beta1.tar.gz ]Extract it [ tar xzvfdrush-All-versions-3.0-beta1.tar.gz ]Make it executable [ chmodu+xdrush ]Alias or PATH it [ alias drush=‘/path/to/drush’ ]Source or Export [ source ~/.bashrc ]
  • 8.
    How to UseNavigateto your site root (or further)cd /var/www/mysiteNote: Drush reads sites/default/settings.php for db infoType ‘drush’ to get a list of commands
  • 9.
    Common CommandsdlDownloads amodule or themeExtracts itExampledrush dl node_pagedrush dl zen
  • 10.
    Common CommandsenEnables amodule or themeExampledrush en node_pagedrush en zen
  • 11.
    Common CommandsccClears DrupalCacheExampledrush ccGives you a choice to clear individual cache or all cache
  • 12.
    Common Commandssql-dumpPerforms amysqldumpExampledrushsql-dumpDon’t forget to redirect your output lest you have it all print to screenDrushsql-dump > out.sql
  • 13.
    Common Commandswatchdog-listView thewatchdog logs basaed on severity levelsExampledrush watchdog-list
  • 14.
    Common CommandsRemember thereare a plethora of commands at your disposalJust type ‘drush’ at the command line for a list of available optionsBecause drush is extendable some modules or profiles (like Aegir) offer additional functionality
  • 15.
    Drush MakeExtremely powerDrush utilityAllows you to wrap up and entire site in a make file and deploy the site basically as a profileBeyond scope of Intro to Drush but worth checking outhttp://drupal.org/project/drush_make
  • 16.
    Try It Yourselfsshadug@173.203.103.240Password: adug!Site path: /var/www/adug/URL: http://173.203.103.240/Site un/pw: admin/adug!Temporary server but please don’t go crazy 
  • 17.
    Topic Suggestions?Meetings 2ndSaturday of every month at 2pmAlways at OS Solutions1244-B Jones St, Augusta, GA 30901steven@ossolutions.orgroger@ossolutions.org888-275-4893Videos and Slides available online @ ossolutions.org and slideshare.net/ossolutions