The Scripts can be found on Codeberg:
Using the scripts
- The backup script will backup the file directory (e.g. /var/www/nextcloud) and the data directory (e.g. /var/nextcloud_data) as tar.gz files. The database backup will be an SQL dump file (*.sql).
- The backups will be stored in some mounted location (e.g. /mnt/Share/NextcloudBackups). This could be anything like a flash drive, external hard drive or a network share.
- To backup your Nextcloud, simply call NextcloudBackup.sh. This will backup Nextcloud to a folder with time stamp (e.g. /mnt/Share/NextcloudBackups/20170910_132703).
- Use the time stamp (20170910_132703) as parameter for the restore script, e.g. simply call NextcloudRestore.sh 20170910_132703.
- Do not use the scripts out of the box: These need to be customized for your specific Nextcloud instance. Everything which needs to be customized is marked with TODO in the script’s comments.
- The scripts assume that your data directory is located outside of your web root.
- If your data directory is located inside the web root, the scripts need to be altered, otherwise the data directory will be copied twice.
Feel free to give it a try. Suggestions and/or contributions are welcome!