Skip to content

Instantly share code, notes, and snippets.

@burningTyger
Created January 11, 2016 08:06
Show Gist options
  • Select an option

  • Save burningTyger/e5a85e24a7802a69ee9b to your computer and use it in GitHub Desktop.

Select an option

Save burningTyger/e5a85e24a7802a69ee9b to your computer and use it in GitHub Desktop.
This is my upgrade script for moodle. Has worked flawlessly for the last two years.
# depending on where you keep your moodle files this is how I'm doing it.
# works on any branch, for major upgrade you need to run this file a last time on the current branch
# then cd into the moodle dir and `git branch` into the newer version in order to get
# the latest updates. Then run the script again to activate.
cd /usr/share/nginx/html/moodle
sudo -u www-data php /usr/share/nginx/html/moodle/admin/cli/maintenance.php --enable;git pull
sudo -u www-data php /usr/share/nginx/html/moodle/admin/cli/upgrade.php
sudo -u www-data php /usr/share/nginx/html/moodle/admin/cli/maintenance.php --disable
sudo -u www-data php /usr/share/nginx/html/moodle/admin/cli/cron.php;cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment