]> git.p6c8.net - nextcloud-backup-restore.git/commitdiff
Remove trailing slash when dir is given by parameter
authorDecaTec <jr@decatec.de>
Wed, 6 Jan 2021 10:16:17 +0000 (11:16 +0100)
committerDecaTec <jr@decatec.de>
Wed, 6 Jan 2021 10:16:17 +0000 (11:16 +0100)
NextcloudBackup.sh

index a0299e66ad4b47c66207d33a6417b95120ec5148..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")

patrick-canterino.de