# However, you should always check the backup/restore scripts BEFORE executing these!
#
# 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
#
backupMainDir='/media/hdd/nextcloud_backup'
nextcloudFileDir='/var/www/nextcloud'
webserverUser='www-data'
#
# Pre defined variables
#
backupMainDir='/media/hdd/nextcloud_backup'
nextcloudFileDir='/var/www/nextcloud'
webserverUser='www-data'
+webserverServiceName='nginx'
#
# Gather information
#
#
# Gather information
#
-read -p "In which directory the backups should be saved (default: ${backupMainDir}). Enter a directory or press ENTER if the backup directory should be ${backupMainDir}: " BACKUPMAINDIR
+clear
+
+echo "Enter the directory to which the backups should be saved."
+echo "Default: ${backupMainDir}"
+echo ""
+read -p "Enter a directory or press ENTER if the backup directory should be ${backupMainDir}: " BACKUPMAINDIR
-read -p "Enter the path to the Nextcloud file directory (usually ${nextcloudFileDir}). Enter a directory or press ENTER if the file directory is ${nextcloudFileDir}: " NEXTCLOUDFILEDIRECTORY
+echo "Enter the path to the Nextcloud file directory."
+echo "Usually: ${nextcloudFileDir}"
+echo ""
+read -p "Enter a directory or press ENTER if the file directory is ${nextcloudFileDir}: " NEXTCLOUDFILEDIRECTORY
-read -p "Enter the webserver user (usually ${webserverUser}). Enter an new user or press ENTER if the webserver user is ${webserverUser}: " WEBSERVERUSER
+echo "Enter the webserver user."
+echo "Usually: ${webserverUser}"
+echo ""
+read -p "Enter an new user or press ENTER if the webserver user is ${webserverUser}: " WEBSERVERUSER