]> git.p6c8.net - nextcloud-backup-restore.git/commitdiff
Backup dir can be specified as parameter
authorDecaTec <jr@decatec.de>
Thu, 3 Jan 2019 11:24:16 +0000 (12:24 +0100)
committerDecaTec <jr@decatec.de>
Thu, 3 Jan 2019 11:24:16 +0000 (12:24 +0100)
NextcloudBackup.sh

index 3e08cb4151dde6690d07ec1e26f034a47968105e..4c95f10ca6a8d92fb77601a8270a214f44dac141 100644 (file)
 #
 
 # Variables
+backupMainDir=$1
+
+if [ -z "$backupMainDir" ]; then
+       # TODO: The directory where you store the Nextcloud backups (when not specified by args)
+    backupMainDir="/mnt/Share/NextcloudBackups"
+fi
+
+echo "Backup directory: $backupMainDir"
+
 currentDate=$(date +"%Y%m%d_%H%M%S")
-# TODO: The directory where you store the Nextcloud backups
-backupMainDir="/mnt/Share/NextcloudBackups"
 # The actual directory of the current backup - this is a subdirectory of the main directory above with a timestamp
 backupdir="${backupMainDir}/${currentDate}/"
 # TODO: The directory of your Nextcloud installation (this is a directory under your web root)

patrick-canterino.de