|
5 days ago | |
---|---|---|
CHANGELOG.md | 5 days ago | |
LICENSE | 7 months ago | |
NextcloudBackup.sh | 5 days ago | |
NextcloudRestore.sh | 5 days ago | |
README.md | 8 months ago | |
setup.sh | 5 days ago |
This repository contains two bash scripts for backup/restore of Nextcloud.
It is based on a Nextcloud installation using nginx and MariaDB (see the (German) tutorial Nextcloud auf Ubuntu Server 18.04 LTS mit nginx, MariaDB, PHP, Let’s Encrypt, Redis und Fail2ban).
For a complete backup of any Nextcloud instance, you'll have to backup these items:
The scripts take care of these items to backup automatically.
Important:
In order to create a backup, simply call the script NextcloudBackup.sh on your Nextcloud machine. If this script is called without parameter, the backup is saved in a directory with the current time stamp in your main backup directory: As an example, this would be /media/hdd/nextcloud_backup/20170910_132703. The backup script can also be called with a parameter specifiying the main backup directory, e.g. ./NextcloudBackup.sh /media/hdd/nextcloud_backup. In this case, the directory specified will be used as main backup directory.
For restore, just call NextcloudRestore.sh. This script expects at least one parameter specifying the name of the backup to be restored. In our example, this would be 20170910_132703 (the time stamp of the backup created before). The full command for a restore would be ./NextcloudRestore.sh 20170910_132703. You can also specify the main backup directory with a second parameter, e.g. ./NextcloudRestore.sh 20170910_132703 /media/hdd/nextcloud_backup.
Next to the backup/restore scripts, there is another script (setup.sh
). The setup script gathers some information and uses the OCC command in order to set the required variables in the backup/restore scripts automatically. This way, the configuration of the backup/restore scripts can be automated to some extend.