Backup and restore scripts that use rsync and tar as a way to backup and restore your files and settings.
These scripts assume that you will be backing up to an external media with a considerable amount of space to store your backups.
Performing Backup
- install Git if it is not installed.
- Clone this Repository
git clone,or download and unzip the zip file. - Copy the
backup.sh Configs and include-lstfiles to a folder of your choice. - Change the variables in the
Configsfile to suit your needs. - Add the path to the
Configsfile in thebackup.shandrestore.shscripts in theCONFIG="/Path/to/Nextcloud-Backup-Restore/Configs"part. - Go to the folder where you placed the scripts and make them executable with the command
sudo chmod a+x. - Run the backup:
sudo /path/to/backup.sh. - Schedule the backup in Cron:
00 00 * * * sudo /path/to/backup.sh
Restore
- edit
backup.shwith editor of your choice and where is"$DIR01" "$DESTINATIONDIR"and change it to the following `"$DESTINATIONDIR" "$DIR01".
This Script performs Backup and Restore of a Nextcloud server installed via snap.
Performing Backup
- install Git if not already installed.
- Clone this Repository
git clone,or download and unzip the zip file. - Copy the files from the Nextcloud Folder to a folder of your choice.
- Change the variables in the
Configsfile to suit your needs. - Do not change the Variable
NEXTCLOUD_CONFIGandTAR_NEXTCLOUD_CONFIGin yourConfigsfile. - Add the path to the
Configsfile in thebackup.shandrestore.shscripts in theCONFIG="/Path/to/Nextcloud-Backup-Restore/Configs"part. - Include the files you do not want to backup from your
./Nextcloud/datafolder in theexclude-lstfile. If you want to backup only some folders or users, include them in theinclude-lstfile and change the command in the script from--exclude-fromto--files-from.. - Make the
backup.sh.andrestore.sh.scripts executable.
Performing Restore
- Make sure your distribution already has snap support enabled, if not do so.
- install the nextcloud snap.
- Run the script
restore.sh.
This Script performs Backup and Restore of Nexcloud and Plexmediaserver configurations installed through snap packages. This script also backs up your /Nextcloud/data. folder.
Performing Backup
- install Git if it is not installed.
- Clone this Repository
git clone,or download and unzip the zip file. - Copy the files from the Nextcloud Plex Folder to a folder of your choice.
- Change the variables in the
Configsfile to suit your needs. - Do not change the variables
NEXTCLOUD_CONFIG.PLEX_CONFIGTAR_NEXTCLOUD_CONFIGTAR_EPLEX_CONFIG.` The Paths for these variables are already backed up and restored correctly for a snap configuration backup. - Add the path to the
Configsfile to thebackup.shandrestore.shscripts in theCONFIG="/Path/to/Nextcloud-Backup-Restore/Configs"part. - Include the files you do not want to backup from your
./Nextcloud/datafolder in theexclude-lstfile. If you want to backup only some folders or users, include them in theinclude-lstfile and change the command in the script from--exclude-fromto--files-from.. - Make the
backup.sh.andrestore.sh.scripts executable.
Performing Restore
- Make sure your distribution already has snap support enabled, if not do so.
- install the nextcloud snap.
- Install the plexmediaserver snap
- Run the script
restore.sh.
This Script performs Backup and Restore of your Nextcloud and emby server settings. This script also backs up your /Nextcloud/data. folder.
Performing Backup
- install Git if it is not installed.
- Clone this Repository
git clone,or download and unzip the zip file. - Copy the files from the Nextcloud Plex Folder to a folder of your choice.
- Change the variables in the
Configsfile to suit your needs. - Do not change the variables
NEXTCLOUD_CONFIG.EMBY_CONFIGTAR_NEXTCLOUD_CONFIGTAR_EMBY_CONFIG`. The Paths referring to these variables are already backed up and restored correctly for a backup of snap settings and default emby (jellyfn) installations. - Add the path to the
Configsfile in thebackup.shandrestore.shscripts in theCONFIG="/Path/to/Nextcloud-Backup-Restore/Configs"part. - Include the files you do not want to backup from your
./Nextcloud/datafolder in theexclude-lstfile. If you want to backup only some folders or users, include them in theinclude-lstfile and change the command in the script from--exclude-fromto--files-from. - Make the
backup.sh.andrestore.sh.scripts executable
Performing Restore
- Make sure your distribution already has snap support enabled, if not do so.
- install the nextcloud snap.
- Install emby
- Run the script
restore.sh.
For Installations run Nextcloud snap and Plex together.
. Use this other script https://github.com/edsonsbj/Nextcloud-Plex-Onlyoffice-Aria2c-qBitorrent to perform the installation and configuration of the packages.
. If after the restore appears any error related to your data folder and ocdata file run these commands:
Linux Partitions
sudo chown -R root:root /patch/Nextcloud/data chmod 0770 /patch/Nextcloud/data.
NTFS partitions
Run the command sudo blkid -o list -w /dev/null and note the uuid of the mounted partition.
Add to your fstab file UUUID=040276482A715ABE /mnt/Nextcloud ntfs-3g utf8,uid=root,gid=root,umask=0007,noatime 0 0. Don't Forget to Replace the UUUID and mountpoint /mnt/Nextcloud from the example above to the uuid and mountpoint corresponding to your drive.