Support

Documentation Akeeba Backup – User's Guide

The CLI update notification and automatic update script

[Note]Note

This CRON script is NOT availabe in Akeeba Ticket System Core.

Since March 2014 all of our software uses Joomla! Extensions Update to determine if there is an extension available and to let you install it. None of our own code is involved in the update provisioning and installation process. However, this means that you need to either log in to your site often to see if there are updates available or subscribe to a third party service which will do that for you. The former is inconvenient when you have multiple sites, the latter is expensive.

This is where our CLI update script come into the big picture. This script will ask Joomla! to tell it if there is an update available for our component. If there is, it can do either (or both) of these actions:

  • Send an email notification to the email address you have specified.

  • Ask Joomla! to install the available update automatically.

[Warning]Warning

AUTOMATIC INSTALLATION OF UPDATES IS A VERY BAD IDEA AND CAN LEAD TO YOUR SITE BECOMING INACCESSIBLE! Read below for more information. Akeeba Ltd does not accept any responsibility for any problems, data loss or other side effects which might arise directly or indirectly from the use, misuse or abuse of our software per the license of the software. Since the actual update code is part of Joomla! itself (it is not written by us) we cannot provide bug fixes, making the use of this script exempt from our support policy. IF YOU DECIDE TO USE THIS SCRIPT TO INSTALL UPDATES OF OUR SOFTWARE AUTOMATICALLY YOU ARE DOING SO AT YOUR OWN RISK.

Joomla! currently does not provide a way to indicate the stability status (alpha, beta, RC, stable), Joomla! version compatibility and PHP version compatibility status of an available update. This means that in the future you might end up having the automatic update CLI script install a version of our software which is unstable or incompatible with your version of PHP or Joomla!. We strongly recommend you to check the Compatibility page on our site to determine which version is compatible with your site.

Furthermore, Joomla! does not provide a rollback feature for failed updates. If for any reason the update process (which is handled by Joomla! itself, not our own code, therefore outside our control) fails while it is copying the component's files you will end up with a partially upgrade component. This can lead to functional issues or even inability to access your site.

Finally, even if you have Akeeba Backup Professional, System Restore Points CAN NOT be taken when installing an update through the CLI update script. If the update fails you are really left with no backup.

Configuring the update script

The update script can be configured from the Options page of the component. Please go to the component's main (control panel) page and click on the Options button. On the new page, click on the Live Update tab. You have the following options:

Download ID

If you have the Professional version of our software please enter your Download ID to allow Joomla! to download subscriber-only updates. The Download ID may change over time: it changes whenever the passwords' hashing ("encryption") on our site is enhanced to increase security, when you change/reset your password on our site or when you change your email address on our site. If you cannot install updates to the Professional release please use the My Subscription page on our site to find out your current Download ID and make sure that you have an active subscription.

Auto-update CLI settings

What you want the update CLI to do when Joomla! reports that a new version is available.

  • Notify and update. It will send you an email to notify you about the available update and immediately ask Joomla! to install it.

  • Notify only. RECOMMENDED. It will only send you an email to notify you about the available update.

  • Update only. Not recommended! It will only ask Joomla! to install the available update, without any further notification.

Notification frequency

The maximum frequency you will be receiving update notification emails if you use the "Notify and update" or "Notify only" options above. This field only contains a number, by default it's 1. Please look at the next option too.

Notification time

The time period expressed by notification frequency. For example, if you set the notification frequency to 1 and the notification time to "days" you will receive update notification emails for the new version at most once a day.

[Important]Important

These two options only define the maximum update notification frequency. You may receive update emails less frequently than what you have set up. It depends on how often then CLI update script runs and how often Joomla! performs the update check. It is always possible that you will not be notified about an update which has been released in the last two days because Joomla! hasn't yet "seen" it.

Email for update notifications

The email address where update notification emails will be sent. If you do not specify an address no update notification email will be sent. You can only specify a singe email address.

Creating a CRON job for the update script

You can only use this feature if you have access to the command-line version of PHP. In order to schedule an automatic update, you will have to use the following command line to your host's CRON interface:

/usr/local/bin/php /home/USER/webroot/cli/ats-update.php

where /usr/local/bin/php is the path to your PHP CLI executable and /home/USER/webroot is the absolute path to your web site's root. You can get this information from your host.

The update script does not accept any parameters.

In order to give you an example, we will assume that your PHP CLI binary is located in /usr/local/bin/php - a common setting among hosts - and that your web site's root is located at /home/johndoe/httpdocs :

usr/local/bin/php /home/johndoe/httpdocs/cli/ats-update.php

Special considerations:

  • Most hosts do not impose a time limit on scripts running from the command-line. If your host does and the limit is less than the required time to send an update notification and/or install the update your site, the update will fail.

  • This script is not meant to run from a web interface. If your host only provides access to the CGI or FastCGI PHP binaries the script may not work with them. The reason is the time constraint explained above.

  • Some servers do not fully support this update method. The usual symptoms will be an update which fails to complete without any further error messages and no indication of something going wrong. In such a case, trying to ryn the update from the back-end of your site will work properly.

Setting up a CRON job on cPanel

Go to your cPanel main page and choose the CRON Jobs icon from the Advanced pane. In the Add New CRON Job box on the page which loads, enter the following information:

Common Settings

Choose the frequency of your backup, for example once per day.

Command

Enter your backup command. Usually, you have to use something like:

/usr/bin/php5-cli /home/myusername/public_html/cli/ats-update.php

where myusername is your account's user name (most probably the same you use to login to cPanel). Do note the path for the PHP command line executable: /usr/bin/php5-cli. This is the default location of the correct executable file for cPanel 11 and later. Your host may use a different path to the executable. If the command never runs, ask them. We can't help you with that; only those who have set up the server know the changes they have made to the default setup.

Finally, click the Add New Cron Job button to activate the CRON job.

Special considerations for HostGator

The location of the PHP CLI binary is /usr/bin/php-cli. This means that your CRON command line should look like:

/opt/php53/bin/php /home/myusername/public_html/cli/ats-update.php

Still need support?

Login or Subscribe to submit a new ticket.

(If filing a bug or you have a pre-sales request, please contact us directly.)