{"id":10480,"date":"2019-04-11T12:20:33","date_gmt":"2019-04-11T16:20:33","guid":{"rendered":"https:\/\/blog.litespeedtech.com\/?p=10480"},"modified":"2019-04-11T12:20:33","modified_gmt":"2019-04-11T16:20:33","slug":"auto-update-litespeed-with-lsup","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2019\/04\/11\/auto-update-litespeed-with-lsup\/","title":{"rendered":"Auto Update With the LSUP Command"},"content":{"rendered":"<p><a href=\"https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-large wp-image-10510\" src=\"https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1-1024x512.jpg\" alt=\"From the Support Desk 01: Auto Update LiteSpeed with lsup\" width=\"1024\" height=\"512\" srcset=\"https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1-1024x512.jpg 1024w, https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1-300x150.jpg 300w, https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1-768x384.jpg 768w, https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1-1536x768.jpg 1536w, https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1-2048x1024.jpg 2048w, https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1-1320x660.jpg 1320w, https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1-600x300.jpg 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Welcome to our new blog series: <a href=\"http:\/\/blog.litespeedtech.com\/tag\/from-the-support-desk\">From the Support Desk<\/a>! From time to time, our support staff will drop in here to impart tips, how-to\u2019s and other pearls of LiteSpeed wisdom.<\/p>\n<p>Today\u2019s topic is: <strong>Auto Update LiteSpeed with the LSUP Command<\/strong><\/p>\n<p><a href=\"https:\/\/www.litespeedtech.com\/products\/litespeed-web-server\">LiteSpeed Web Server<\/a>\u2019s <strong>lsup<\/strong> command is used primarily to update LSWS to the latest version from the command line. But now, with the addition of a tier system, stable version updates may be safely automated from your system cron! Read on to learn about the new Stable Tier, how it differs from the Edge Tier, and how to use this much-requested new feature.<\/p>\n<h2>Basic Usage<\/h2>\n<p>The <strong>lsup<\/strong> command is a simple way to update LiteSpeed Web Server from the command line, and allows the possibility of upgrading LSWS installations in bulk with a single command.<\/p>\n<p>You can find <strong>lsup<\/strong> located at <code>$SERVER_ROOT\/admin\/misc\/lsup.sh<\/code>. In most CentOS installations, that would mean this is the full command:<\/p>\n<pre class=\"prettyprint\">\/usr\/local\/lsws\/admin\/misc\/lsup.sh\n<\/pre>\n<p>Running <strong>lsup<\/strong> without parameters will automatically upgrade your installation of LiteSpeed Web Server to the latest stable release, assuming you are following the Stable Tier (more on that later).<\/p>\n<h2>Automation<\/h2>\n<p>The new tier system allows you to automate your LSWS Stable Tier updates. Safely set up a cron job to keep all of your LSWS installations current with the latest stable version.<\/p>\n<p>To automate Stable Tier updates in the cron, use <code>lsup.sh<\/code> <em>with no parameters<\/em>.<br \/>\n<strong>IMPORTANT<\/strong>: If you have previously set up a cron job for <code>lsup.sh<\/code>, please verify that there are no parameters included!<\/p>\n<h2>Other Options<\/h2>\n<p>The following parameters are available for use with <strong>lsup<\/strong>:<\/p>\n<ul>\n<li><code>-f<\/code>: If you already have the most recent stable version installed, the basic, no-parameter <strong>lsup<\/strong> command will abort. The <code>-f<\/code> option forces <strong>lsup<\/strong> to install the latest edge build.<\/li>\n<li><code>-v<\/code>: You can control what version of LSWS you install with the <code>-v<\/code> option, followed by a version number. For example: <code>.\/lsup.sh -v 5.3.6<\/code>. This will allow you to downgrade to an older version if you experience a problem with the current one, or upgrade to a specific edge version.<\/li>\n<li><code>-b<\/code>: This parameter designates a build number. All versions start from build <code>0<\/code>. <strong>lsup<\/strong> will automatically upgrade to the latest build of the designated version if <code>-b<\/code> is not set. (Note: this option is only available for LSWS versions 5.0 and higher.) To view what build you are currently using, display the contents of <code>\/usr\/local\/lsws\/autoupdate\/build<\/code>.<\/li>\n<\/ul>\n<p>If you are looking to upgrade\/downgrade to a particular version or build, but don\u2019t know the numbers, you can look them up <a href=\"https:\/\/www.litespeedtech.com\/products\/litespeed-web-server\/release-log\">on our wiki<\/a>.<\/p>\n<h3>Usage Examples<\/h3>\n<p>You can use <strong>lsup<\/strong> to force updates to any version or build.<\/p>\n<p>Version 5.3.7:<\/p>\n<pre class=\"prettyprint\">\/usr\/local\/lsws\/admin\/misc\/lsup.sh -f -v 5.3.7\n<\/pre>\n<p>Version 5.3.7 build 4:<\/p>\n<pre class=\"prettyprint\">\/usr\/local\/lsws\/admin\/misc\/lsup.sh -f -v 5.3.7 -b 4\n<\/pre>\n<p>Edge version 5.4RC3:<\/p>\n<pre class=\"prettyprint\">\/usr\/local\/lsws\/admin\/misc\/lsup.sh -f -v 5.4RC3\n<\/pre>\n<p><strong>IMPORTANT<\/strong>: Please never use these other parameters when automating updates via cron! These are only for command-line use.<\/p>\n<h2>Stable Tier vs. Edge Tier<\/h2>\n<p>So about that new tier system&#8230; Starting from version 5.3.7 build 4, the <strong>lsup<\/strong> command will be able to distinguish between two tiers: Stable and Edge. (This tier system is not available on older versions \u2013 please upgrade, if you want to use it.)<\/p>\n<p><code>lsup.sh<\/code> is for updating to the most recent stable release (Stable Tier).<\/p>\n<p><code>lsup.sh -f<\/code> is for forcing an update to the most cutting edge build available (Edge Tier).<\/p>\n<h3>follow_stable<\/h3>\n<p>The behavior of <strong>lsup<\/strong> is influenced by the new <code>follow_stable<\/code> marker, located in <code>\/usr\/local\/lsws\/autoupdate\/follow_stable<\/code>.<\/p>\n<p>The first time you upgrade to v5.3.7 b4 (or later), this marker will be automatically created, ensuring that your auto-updates will continue to default to the Stable Tier.<\/p>\n<h3>Edge Builds<\/h3>\n<p>If you like living on the edge, you can use <code>lsup.sh -f<\/code>. The <code>-f<\/code> parameter installs the edge build, which is the absolute latest available, and it will remove the <code>follow_stable<\/code> marker, if it exists.<\/p>\n<p>If you change your mind and want to go back to following the Stable Tier, simply create the <code>follow_stable<\/code> marker again, like so:<\/p>\n<pre class=\"prettyprint\">touch \/usr\/local\/lsws\/autoupdate\/follow_stable\n<\/pre>\n<h3>Specific Versions<\/h3>\n<p>You can also force a particular version to install, such as with <code>lsup.sh -f -v &lt;version&gt;<\/code>. In this case, as well, the <code>follow_stable<\/code> marker will be removed, as long as the specified version is <em>different<\/em> than the latest stable version.<\/p>\n<p>Conversely, if the <code>follow_stable<\/code> marker doesn\u2019t already exist, and the specified version is the <em>same<\/em> as the latest stable version, the marker will be created.<\/p>\n<p>Here\u2019s a handy table to illustrate how all of these elements work together:<\/p>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><strong><code>follow_stable<\/code> marker exists<\/strong><\/td>\n<td><strong><code>follow_stable<\/code> doesn\u2019t exist<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong><code>lsup.sh<\/code> with no parameters<\/strong><\/td>\n<td>latest Stable Tier build installed<\/td>\n<td>nothing is installed<br \/>\nmarker may be created*<\/td>\n<\/tr>\n<tr>\n<td><strong><code>lsup.sh -f<\/code><\/strong><\/td>\n<td>latest Edge Tier build installed<br \/>\nmarker deleted<\/td>\n<td>latest Edge Tier build installed<\/td>\n<\/tr>\n<tr>\n<td><strong><code>lsup.sh -f -v &lt;version&gt;<\/code><\/strong><\/td>\n<td>&lt;version&gt;\u2019s latest build installed<br \/>\nmarker may be deleted**<\/td>\n<td>&lt;version&gt;\u2019s latest build installed<br \/>\nmarker may be created***<\/td>\n<\/tr>\n<tr>\n<td><strong><code>lsup.sh -f -v &lt;version&gt; -b &lt;build&gt;<\/code><\/strong><\/td>\n<td>&lt;version&gt; &lt;build&gt; installed<br \/>\nmarker may be deleted**<\/td>\n<td>&lt;version&gt; &lt;build&gt; installed<br \/>\nmarker may be created***<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><small>*if currently-installed version is the same as the latest stable version and build<br \/>\n**if specified &lt;version&gt; and\/or &lt;build&gt; is different than the latest stable version and build.<br \/>\n***if specified &lt;version&gt; and\/or &lt;build&gt; is the same as the latest stable version and build.<\/small><\/p>\n<h3>Using follow_stable to Control Cron Updates<\/h3>\n<p>As you can see from the table above, <code>lsup.sh<\/code> with no parameters will always install the latest stable version, as long as the <code>follow_stable<\/code> marker exists. If the marker does not exist, then <code>lsup.sh<\/code> with no parameters installs <em>nothing<\/em>.<\/p>\n<p>This is important. It means that even when you have temporarily installed an edge build or downgraded to an older version, you can leave your daily cron job in place. When you are purposely working with a specific LSWS version, you don\u2019t want the cron to come along and change everything. You want it to do nothing until you are ready.<\/p>\n<p>Once your specific-version work has concluded, you can put the marker back in place and regular updates will resume automatically.<\/p>\n<p>Alternately, if you are working with an edge build, you can simply wait for that edge build to be added to the Stable Tier. The next time <strong>lsup<\/strong> runs, the marker will automatically be recreated and stable updates will resume.<\/p>\n<h2>Conclusion<\/h2>\n<p>With the release of LSWS v5.3.7 b4, it is now possible to automate LiteSpeed Web Server updates through a regular system cron job. We hope this article has given you a full understanding of how the new tier system works, but if you have any questions, please leave a comment. We\u2019ll be happy to help. See you next time!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to update LSWS with lsup.sh from the command line or cron.<\/p>\n","protected":false},"author":1,"featured_media":10510,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[27],"tags":[116,172],"class_list":["post-10480","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-server","tag-from-the-support-desk","tag-lsup"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2019\/04\/Support-Desk-01-1.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/10480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=10480"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/10480\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/10510"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=10480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=10480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=10480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}