Cosmetic improvement to remove double slash in verbose output when backing up root

This commit is contained in:
2020-01-13 15:44:55 +01:00
parent 7826addc26
commit 84855cded6

View File

@@ -86,9 +86,17 @@ step_3() {
echo " [I] Target : $BACKUP_TARGET"
echo " [I] Excludes: $@"
#fix doubling trailing slash on verbose output when backing up root
local buSource="$BACKUP_SOURCE/"
local buTarget="${BACKUP_TARGET}/$(basename ${BACKUP_SOURCE})"
if [ "$BACKUP_SOURCE" == "/" ] ; then
buSource="/"
buTarget="${BACKUP_TARGET}/"
fi
exep "mount -o rw,remount '${BACKUP_TARGET}' >>/dev/null 2>&1"
exep "mv -f ${BACKUP_TARGET}/${BACKUP_LOG}0.log /tmp/${BACKUP_LOG}1.log 2>/dev/null"
exep "rsync -avAX --delete --info=stats2 ${BU_EXCLUDES[*]} ${BACKUP_SOURCE}/ ${BACKUP_TARGET}/$(basename ${BACKUP_SOURCE}) > /tmp/${BACKUP_LOG}0.log"
exep "rsync -avAX --delete --info=stats2 ${BU_EXCLUDES[*]} ${buSource} ${buTarget} > /tmp/${BACKUP_LOG}0.log"
exe mv -f /tmp/${BACKUP_LOG}*.log ${BACKUP_TARGET}
exe sync