From 371fa270c89ef7cb2929578394ea28c70cd9ff05 Mon Sep 17 00:00:00 2001 From: DecaTec Date: Wed, 6 Jan 2021 11:16:17 +0100 Subject: [PATCH 1/1] Remove trailing slash when dir is given by parameter --- NextcloudBackup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NextcloudBackup.sh b/NextcloudBackup.sh index a0299e6..5606883 100644 --- a/NextcloudBackup.sh +++ b/NextcloudBackup.sh @@ -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") -- 2.34.1