I want to obtain the information if an Nextcloud update is available. If there is then I would like to get the version number of the latest stable Nextcloud server release from within my backup script. This script runs on a daily basis and sends the log that contains some additional information plus attachment via email.
This is the environment:
Nextcloud version: 126.96.36.199
Operating system and version: armbian 5.37; Debian GNU/Linux 8 (jessie) 4.13.16-sunxi
Apache or nginx version: Apache 2.4.10
PHP version: 5.6.33
In the last couple of days I found out following methods to do so:
Using the script
-> It does what I aim for but I don’t want to run the automated update process (at least not yet). However, there is no option to only output the available update retrieved via the updater server. So, I am only interested in the initial part of the program.
Initiate query URL to receive the latest version information using
-> Seems to be exactly what I want to achieve. From what I learned this is the same method as
updater.pharqueries the official Nextcloud project server.
Parsing of https://github.com/nextcloud/server/releases.atom
-> I consider this as suboptimal due to the additional burden of parsing the retrieved data.
Option 2 is the way I implemented in my backup script. Unfortunately, I could neither find much information on how to build that url nor the server response if (a) no updates are available or if (b) updates are available. I spent quite some time on trying to reengineer the query string from specific content of
version.php and php version number.
Googling on this topic brought me to Xela’s revealing blog post  that contains a nice script which does exactly what I was looking for.
It would be great if similar information on how to query the updater server is discussed in the administrator documentation for Nextcloud maintenance reasons.
Thanks a lot and keep up the great work!!!