2 min read

Using Drush to Check Site Status

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.

drush @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

2 min read

What Can Drush Do For You? Part 1 of 4

Drush is a command line interface tool used to help manage and maintain Drupal installations. Even novice Drupal developers soon realize how much of a benefit Drush can be. From creating aliases, to...
3 min read

Why You Should Use Product Videos to Improve Conversions

Video marketing is all the rage right now and the statistics around this trend are staggering. If you aren't using or haven’t considered including it in your marketing arsenal, you are missing out on...
1 min read

Syncing Environments Using Drush

Now that you have learned what a helpful tool Drush can be for all Drupal developers, let's think about how this, in combination with other command line tools, can make your jobs even easier. Any...
2 min read

Acquia Engage 2023: The AI Revolution Transforms Digital Marketing

I recently attended the Acquia Engage 2023 Conference in Boston, where Acquia outlined transformative strategies for customer experiences that were exciting and groundbreaking. Between new...