X-Git-Url: https://git.p6c8.net/nextcloud-backup-restore.git/blobdiff_plain/cdb5a0f067936452de7e6682f9650b655f52a6c1..HEAD:/setup.sh?ds=sidebyside diff --git a/setup.sh b/setup.sh index 89543df..2f384ba 100755 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,7 @@ # # Bash script an easy setup of NextcloudBackup.sh and NextcloudRestore.sh # -# Version 2.0.0 +# Version 2.3.3 # # Usage: # - call the setup.sh script @@ -19,6 +19,9 @@ # However, you should always check the backup/restore scripts BEFORE executing these! # +# Make sure the script exits when any command fails +set -Eeuo pipefail + # # Pre defined variables # @@ -59,7 +62,7 @@ clear echo "Enter the webserver service name." echo "Usually: nginx or apache2" echo "" -read -p "Enter an new webserver service name or press ENTER if the webserver user is ${webserverServiceName}: " WEBSERVERSERVICENAME +read -p "Enter an new webserver service name or press ENTER if the webserver service name is ${webserverServiceName}: " WEBSERVERSERVICENAME [ -z "$WEBSERVERSERVICENAME" ] || webserverServiceName=$WEBSERVERSERVICENAME clear @@ -86,7 +89,7 @@ occ_get datadirectory if [ $? -ne 0 ]; then echo "Error calling OCC: Please check if the information provided was correct." - echo "ABORTING!" + echo "ABORTING!" echo "No file has been altered." exit 1 fi @@ -101,8 +104,8 @@ echo "Modifying NextcloudBackup.sh and NextcloudRestore.sh to match your install echo "" # Backup main dir -sed -i "s@^ backupMainDir.*@ backupMainDir='$backupMainDir'@" ./NextcloudBackup.sh -sed -i "s@^ backupMainDir.*@ backupMainDir='$backupMainDir'@" ./NextcloudRestore.sh +sed -i "s@^\tbackupMainDir='/media/hdd/nextcloud_backup'@\tbackupMainDir='$backupMainDir'@" ./NextcloudBackup.sh +sed -i "s@^\tbackupMainDir='/media/hdd/nextcloud_backup'@\tbackupMainDir='$backupMainDir'@" ./NextcloudRestore.sh # Nextcloud file dir sed -i "s@^nextcloudFileDir.*@nextcloudFileDir='$nextcloudFileDir'@" ./NextcloudBackup.sh @@ -157,4 +160,6 @@ echo "" echo "" echo "IMPORTANT: Please check NextcloudBackup.sh and NextcloudRestore.sh if all variables were set correctly BEFORE running these scripts!" echo "" +echo "When using pigz compression, you also have to install pigz (e.g. for Debian/Ubuntu: apt install pigz)" +echo "" echo "" \ No newline at end of file