This is a good question because some people question how much more effective drush can make you, and the answer is, "ninja works it".
We needed to delete all nodes of a certain content type. No, you can't just go into MySQL command line and run "delete from node;" and expect good things to happen. So we wrote a quick plugin to drush and bam
$ drush node-deletebytype article
>63 nodes deleted
Can you imagine if you had do selects on the checkboxes in the admin interface for that? What if you had 6000 nodes (as we often did when importing lots of content). If you don't want to write your own plugin, the Delete All 6.x-dev version has drush integration, and there is a patch available for D7.
But wait, that's not all, you also get the great combination of using drush and piping the output to other commands like grep. Let's say I have a big development site testing out lots of new features and I can't remember all the facebook modules I'm trying out, well drush to the rescue:
$ drush pm-list | grep -i facebook
Drupal for Facebook - contrib Register Users (fb_register.module) (fb_register) Module Not installed 6.x-3.0-rc3
Drupal for Facebook - contrib Rules Integration (fb_rules.module) (fb_rules) Module Not installed 6.x-3.0-rc3
Facebook connect Fbconnect Events (fbconnect_events) Module Disabled
Facebook Social Facebook Friends Invite (fbconnect_invite) Module Not installed 6.x-2.0-beta1
But wait, that's not all, it slices [out your sql queries for text usage]
drush sql-query "select * from users;" > userlist.txt
It dices out those bad seeds [of code that give you a white screen of death and thus prevent you from disabling via the admin interface]
drush dis that_custom_module_with_mo_code_mo_probs
But wait! It juliennes [those files and dbs and sends them to prod] too!
drush rsync demosite.drupal6.local @peer
drush sql-sync demosite.drupal6.local @peer
And oh my, I just learned it can work on remote sites using aliases such as the above
so we can turn
drush username@myserver.com/path/to/drupal#mysite.com status
into
drush @dev status
Drush (as seen on Drupal.org), it's better than sliced bread. Get yours today!
Comments
Berdir
Sat, 03/05/2011 - 00:54
"and some really great users
"and some really great users like Dave Reid, berdir, tim plunkett, mark trapp, and on and on)"
/me feels very important now
;)
moshe weitzman
Sat, 03/05/2011 - 07:19
love it
Food and drush are a lovely combination. Thanks for the post.
Add new comment