]> git.p6c8.net - nextcloud-backup-restore.git/blobdiff - NextcloudBackup.sh
Remove trailing slash when dir is given by parameter
[nextcloud-backup-restore.git] / NextcloudBackup.sh
index 0b03af13afe5deaf85510261289b47392cf9ab9a..5606883116af67092d031e0cba0e8d924bda2970 100644 (file)
@@ -24,6 +24,8 @@ backupMainDir=$1
 if [ -z "$backupMainDir" ]; then
        # TODO: The directory where you store the Nextcloud backups (when not specified by args)
     backupMainDir='/media/hdd/nextcloud_backup'
+else
+       backupMainDir=$(echo $backupMainDir | sed 's:/*$::')
 fi
 
 currentDate=$(date +"%Y%m%d_%H%M%S")
@@ -206,6 +208,7 @@ echo
 # Backup local external storage.
 # Uncomment if you use local external storage
 #echo "Creating backup of Nextcloud local external storage directory..."
+
 #if [ "$useCompression" = true ] ; then
 #      tar -cpzf "${backupdir}/${fileNameBackupExternalDataDir}"  -C "${nextcloudLocalExternalDataDir}" .
 #else

patrick-canterino.de