X-Git-Url: https://git.p6c8.net/nextcloud-backup-restore.git/blobdiff_plain/e7157ba0a3afd98929faca45928e6ad9376ec41b..refs/heads/master:/NextcloudRestore.sh?ds=sidebyside diff --git a/NextcloudRestore.sh b/NextcloudRestore.sh index a18ecd0..5febde7 100644 --- a/NextcloudRestore.sh +++ b/NextcloudRestore.sh @@ -3,7 +3,7 @@ # # Bash script for restoring backups of Nextcloud. # -# Version 2.3.0 +# Version 2.3.3 # # Requirements: # - pigz (https://zlib.net/pigz/) for using backup compression. If not available, you can use another compression algorithm (e.g. gzip) @@ -29,12 +29,12 @@ set -Eeuo pipefail # Variables -restore=$1 -backupMainDir=$2 +restore=${1:-} +backupMainDir=${2:-} if [ -z "$backupMainDir" ]; then # TODO: The directory where you store the Nextcloud backups (when not specified by args) - backupMainDir='/media/hdd/nextcloud_backup' + backupMainDir='/media/hdd/nextcloud_backup' fi echo "Backup directory: $backupMainDir" @@ -46,7 +46,7 @@ useCompression=true # TOOD: The bare tar command for using compression. # Use 'tar -xmpzf' if you want to use gzip compression. -compressionCommand="tar -I pigz -cpf" +compressionCommand="tar -I pigz -xmpf" # TODO: The directory of your Nextcloud installation (this is a directory under your web root) nextcloudFileDir='/var/www/nextcloud' @@ -302,18 +302,18 @@ echo "Done" echo # -# Update the system data-fingerprint (see https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#maintenance-commands-label) +# Disbale maintenance mode # -echo "$(date +"%H:%M:%S"): Updating the system data-fingerprint..." -sudo -u "${webserverUser}" php ${nextcloudFileDir}/occ maintenance:data-fingerprint +echo "$(date +"%H:%M:%S"): Switching off maintenance mode..." +sudo -u "${webserverUser}" php ${nextcloudFileDir}/occ maintenance:mode --off echo "Done" echo # -# Disbale maintenance mode +# Update the system data-fingerprint (see https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#maintenance-commands-label) # -echo "$(date +"%H:%M:%S"): Switching off maintenance mode..." -sudo -u "${webserverUser}" php ${nextcloudFileDir}/occ maintenance:mode --off +echo "$(date +"%H:%M:%S"): Updating the system data-fingerprint..." +sudo -u "${webserverUser}" php ${nextcloudFileDir}/occ maintenance:data-fingerprint echo "Done" echo