To automate our environment we wrote this shell script. It may wont work in your environment, but maybe you get some ideas for your own script.
- Download the moodle-update file into /var/www
- Make it executable ("chmod u+x")
At the top of the script you have to check the list of folders which shall be used in the new moodle version. It's the FOLDER[]-Array. Modify it to your needs.
- You can run the script with or without a moodle version paramter to install the latest version: ./update-moodle 3.5
- You can also add an URL as 2nd parameter to specify the download source: ./update-moodle 3.5 https://example.com/moodle-3.5.2.zip
- If a newer version is available, the script will inform you about it.
- To restore a backup use: moodle-restore foldername
- It has to be the same version (x.y) as in use.