From e47e1791690c9e2781d01634f763ee730bc1e327 Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 30 Jul 2018 16:28:12 +0200 Subject: [PATCH] Fix for path strip on '/' backups --- dev/n_obackup.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dev/n_obackup.sh b/dev/n_obackup.sh index 6acdd5e..6b6e828 100755 --- a/dev/n_obackup.sh +++ b/dev/n_obackup.sh @@ -1462,10 +1462,10 @@ function FilesBackup { if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then # Fix for backup of '/' - if [ "${backupTask#/}" == "/" ]; then - destinationDir="$FILE_STORAGE/${backupTask#/}" + if [ "${backupTask#/}/" == "/" ]; then + destinationDir="$FILE_STORAGE/${backupTask#/}/" else - destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") + destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}/") fi else destinationDir="$FILE_STORAGE" @@ -1497,10 +1497,10 @@ function FilesBackup { if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then # Fix for backup of '/' - if [ "${backupTask#/}" == "/" ]; then - destinationDir="$FILE_STORAGE/${backupTask#/}" + if [ "${backupTask#/}/" == "/" ]; then + destinationDir="$FILE_STORAGE/${backupTask#/}/" else - destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") + destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}/") fi encryptDir="$FILE_STORAGE/${backupTask#/}" else @@ -1533,10 +1533,10 @@ function FilesBackup { if [ "$KEEP_ABSOLUTE_PATHS" != "no" ]; then # Fix for backup of '/' - if [ "${backupTask#/}" == "/" ]; then - destinationDir="$FILE_STORAGE/${backupTask#/}" + if [ "${backupTask#/}/" == "/" ]; then + destinationDir="$FILE_STORAGE/${backupTask#/}/" else - destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}") + destinationDir=$(dirname "$FILE_STORAGE/${backupTask#/}/") fi else destinationDir="$FILE_STORAGE"