2 min read

Using Drush to Check Site Status

We recently discussed how you can use Drush to maintain modules on your site. You can also use Drush to learn important configuration information, or discover errors that have been logged, without ever having to sign in to the admin side of a site.  Here are a few commands you can type to gain information about the site you are currently working on.

Drupal Drush Logodrush @alias status

In the above command, @alias is not needed, but why not take advantage of the aliases we set up earlier? Without the @alias Drush will attempt to guess what site you are working on. If the site is a Drupal multi-site, you will have to make your current working directory the multi-site you desire. If nothing is given it will default to 'default'. The status command will provide information about your Drupal installation, and some Drush configuration information as well.

Instead of logging into the admin side of a site to check the status report, save yourself a few steps by running the check from the command line.

drush rq

The command line also allows for easy manipulation of data to get exactly the information you are looking for. This is a handy tool when you need to check the overall configuration status of a site. A lot of information is released, helping to determine what, if any, work needs to be done.

Drupal keeps a log called 'Watchdog' in order to track everything happening on a site. This log can contain some critical information. And, yes, this can also be accessed via Drush.

drush ws

By default this will display the last 10 messages logged, but like all the other commands there is a bank of arguments and flags available to tailor the output to exactly what is needed. Keep in mind the database logging modules must be enabled in order for Watchdog to record events.

Although there are nice tools that help expedite certain tasks, sometimes you still need to log in in to the admin side. This could be as easy as adding /user to the address bar. However, if you are a web developer with many clients, it makes more sense to use the command the nice guys who made Drush wrote:

drush uli

This prints a link that can be used to log in as the admin user as a one-time authentication. If you are working locally, this will even open a browser to the specified URL.

The beauty of Drush is that many of these commands can be used with the Site Aliases that we created. That way without ever having to change a directory, you can check up on, and maintain all of your clients.

Next time I will go over ways to automate the syncing of environments using Drush.

Related Posts

1 min read

Greenopolis.com Sponsors Drupalcon Boston 2008

Greenopolis.com (Beta) was featured as a Gold Sponsor of Drupalcon Boston 2008, a gathering of over 800 Drupal professionals.
2 min read

End of Life Date for Drupal 6 Announced: February 24, 2016

  Last month, the widely used open source website development platform, Drupal, dropped some good news and some bad news. The amazingly good news was the release of Drupal 8, on November 19th, 2015....
2 min read

Should I Upgrade to Drupal 7 or Drupal 8?

As Drupal 6 gets dangerously close to its End of Life Date, users currently running on that version are left wondering what to do next. Should you upgrade to Drupal 7 or Drupal 8? Your decision will...
2 min read

Are You Ready For The Drupal 9 Upgrade?

Saying Goodbye to Drupal 8 Drupal 9 has made its grand entrance, which means web developers must prepare to say goodbye to Drupal 8. In the world of web development, we are used to adapting our...