WpW: Exploring LiteSpeed’s WHM Plugin CLI Script

December 6th, 2017 by LSCache 0 Comments

Welcome to another (our 30th!) installment of WordPress Wednesday!

Back in June we talked about the things you could do with our WHM plugin’s CLI script. At that time, the script was limited to two commands: scan and enable. Today, there are an additional six commands to talk about! Let’s jump right in, shall we?

setversion

setversion [--list] | [--latest] | [$VERSION]
This command lists or sets the active LSCWP version. The active version of the plugin is not necessarily the most recent release. It’s the version that you have chosen to be the default version on all of your installations. You can set the active version to be the most recent release with the --latest parameter, or you can specify an earlier version of your choice.

Examples
Display the currently active version:

./lscmctl setversion

Display currently-available versions:

./lscmctl setversion --list

Switch to the latest available version:

./lscmctl setversion --latest

Set the currently active version to 1.6.3:

./lscmctl setversion 1.6.3

disable

disable -m | $WP_PATH
Disable the LSCWP plugin. The -m parameter, for all commands where it is an option, always refers to “mass.” It should be used whenever you want to run a command for all known (and unflagged) installations.

Examples
Disable LSCWP in all discovered WordPress installations:

./lscmctl disable -m

Disable LSCWP only in user Larry’s WP installation:

./lscmctl disable /home/larry/public_html/wp

upgrade

upgrade -m | $WP_PATH
Upgrade LSCWP to the current active version. Usage is similar to that of disable.

Example
Upgrade LSCWP only in user Liz’s installation:

./lscmctl upgrade /home/liz/public_html/wp

flag

flag $WP_PATH
Flag a single WordPress installation. Flagged installations will be skipped during mass operations.

unflag

unflag $WP_PATH
Unflag a single WordPress installation. Unflagging a previously-flagged installation will allow it to once again be included in subsequent mass operations.

status

status $WP_PATH
This command answers the following questions about the given WordPress installation:

  • Is this installation unflagged? flagged? flagged due to some error?
  • Is LSCWP enabled or disabled in this installation? Is there a conflict with another cache plugin?

Example
Get LSCWP status for a single installation:

./lscmctl status /home/user/public_html/wp

These commands make short work of managing your WordPress installations. You can simplify your life even further by hooking some of them into the cron. For instance, you can schedule a ./lscmctl setversion --latest command, followed by a ./lscmctl upgrade -m command to run every Sunday night, so that all of the installations you manage are running the latest version of LSCWP on Monday morning.

If you feel like you’re missing some of the background for all of this, I suggest you read Autodiscovery, LSCache and the Command Line. We went into quite a bit of detail talking about the CLI script, what it does, and how to automate its functions with cron jobs.

Do you use our CLI script? Do you have any tricks or useful workflow tips to share? Leave them in the comments!


Have some of your own ideas for future WordPress Wednesday topics? Leave us a comment!

Don’t forget to meet us back here next week for the next installment. In the meantime, here are a few other things you can do:


Categories:LSCache

Related Posts


Comments