项目作者: PietsHost

项目描述 :
📃 This script features an automatic Backup & Update of your Nextcloud installation, using occ.
高级语言: Shell
项目地址: git://github.com/PietsHost/nextcloud-Update-Script.git
创建时间: 2017-03-09T21:04:50Z
项目社区:https://github.com/PietsHost/nextcloud-Update-Script

开源协议:

下载


Nextcloud Update-Script

GitHub issues
GitHub release
irc

This script features an automatic Backup & Update of your Nextcloud installation, using occ.


The script will check your installed version (e.g. 10.0.0) and the latest release-version (e.g. 10.0.2).

If an update is available, the script will backup the following folders: /data, /config, /themes, /apps

It also backups your current database - just in case, the upgrade goes wrong!

The script will check whether the backup was successful or not, and then it begins the update process by downloading the latest release.

If everything goes as expected, the script will use the occ upgrade command to upgrade your nextcloud installation. You will receive an email upon successful installation. If the upgrade process fails, your database will be restored

That’s it! Visit your website and enjoy the latest version of Nextcloud!

original update script was found at the official Nextcloud VM by Tech and Me, maintened by:

Usage

Simply change lines 22 - 35 to suit your needs:

  1. # Directories - change the following lines to suit your needs
  2. html=/var/www/html # root html directory
  3. backup=$html/backup_`date +"%Y%m%d"` # name of the backup folder, which will be created
  4. ncpath=$html/nextcloud1 # name of subfolder in html directory, where your nextcloud installation is located
  5. email="example@domain.com" # will be used for sending emails, if upgrade was successfull
  6. htuser='apache' # Webserver-User (CentOS: apache, suseLinux: wwwrun, etc..)
  7. htgroup='apache' # Webserver-Group (CentOS: apache, suseLinux: www, etc...)
  8. name=nextcloud_install_1 # Define a name for your Instance, which will be upgraded
  9. # Database Variables
  10. dbserver=127.0.0.1 # Database host
  11. database="databasename" # Database name
  12. user="databaseuser" # Database username
  13. pass="S€crEtP@s$" # Database password

After that, set +x to the script and run it:

  1. chmod +x ./ncupdate.sh
  2. ./ncupdate.sh

By default, the script will leave the folders “data”, “config”, “apps” and “themes” within your nextcloud path.

That’s usefull for example if you have mass data and copying data to another folder would take too long..

You can enable a file backup (copy data files to another folder) by starting the script with “-b” option:

./ncupdate.sh -b

“-d” enables backup of external data directory, e.g. it’s stored in /home/data:

./ncupdate.sh -bd /home/data

Notes

  • Tested on CentOS 6.8 & 7.3
  • Tested on openSUSE Leap 42.1

I’m sure it will work on every Linux System, even if I haven’t tested it yet :)

Requirements

This script requires the following packages: bzip2 rsync pv php5-posix

  • CentOS / RHEL:
    1. yum install -y bzip2 rsync pv php5-posix
  • openSUSE:
    1. zypper in bzip2 rsync pv php5-posix

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.