Site management

Once you have entered the sites that you wish to manage, you can manage them with commands like so:

Show configured sites

# wordshell --listsites
mysite Enabled ftp:[email protected] /htdocs | http://www.example.com
mysite2 Enabled file:///var/www/webusers/example2.com/htdocs | http://www.example2.com

Enable/Disable management of a site

WordShell has commands to perform operations on every known site (e.g. list updates, update a particular plugin). You may want to keep sites in your configuration file, but not do anything with them (i.e. exclude them from such operations). You can do this via disabling such sites (and re-enabling them when needed), like so:

wordshell mysite --disablesite

and:

wordshell mysite --enablesite

You can remove a site permanently from the configuration file (and remove it from any groups it is a member of) with:

wordshell mysite --delsite

If you ever need to edit the WordShell configuration file, which by default is in ~/.wordshell/rc, then you can do so quickly like this:

wordshell --editconfig

Site options

Some sites may have particular options which you always want to use with them. For example, a particular site might be accessed by FTP – but the FTP server might only allow a certain maximum number of connections at once. (WordShell tries to use parallel connections to make things go faster).

If the site allows only 9 connections at once, then you could remember to always add –ftpparallel=9 to your command line, as in this example for updating the akismet plugin:

wordshell mysite akismet --latest --ftpparallel=9

That would quickly get tedious, and you might forget. To make life easier, you can instead configure “–ftpparallel=9” as a permanent “site option”. To do this, edit the WordShell configuration file, and add a new line in this format:

siteopt#mysite#--ftpparallel=9

The format is: siteopt

If you want multiple options for a site, then place them each their own individual line (not on a single line). Obviously, some site options would be crazy; for example, it would make no sense to specify a particular mode, such as–list, as a site option: this would then only allow you to carry out list operations on the site and nothing else.

There is one difference between how WordShell processes site options found in the configuration file, and those on the command line. Those on the command line are sanity checked and checked for validity; those in the configuration file are not. This means that you can safely specify options which are only valid in certain contexts. For example, the switch –justwp only makes sense with –core; if you use it otherwise on the command line then WordShell will abort. But if you specify it as a site option in the configuration file, then it will be read and only used when relevant.

Now that you are comfortable adding and managing sites, it is time to look more carefully at the basic form of a WordShell command.

Chapter index: Starting to use WordShell

Leave a Reply

Site Map