From 5a56965a4819f7bea91f130ca7c3d7abc6ff532d Mon Sep 17 00:00:00 2001 From: Alice Ferrazzi Date: Sat, 9 Feb 2019 02:11:46 +0900 Subject: [PATCH] Create nested directory for backup /home/myhome/dir1/dir2/ is not a directory create it now? The expected result is that it create the folder also if is nested. --- helper-scripts/backup_and_restore.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper-scripts/backup_and_restore.sh b/helper-scripts/backup_and_restore.sh index d6e34c4a..48b6bdbf 100755 --- a/helper-scripts/backup_and_restore.sh +++ b/helper-scripts/backup_and_restore.sh @@ -36,7 +36,7 @@ if [[ ! -d ${BACKUP_LOCATION} ]]; then if [[ ! ${CREATE_BACKUP_LOCATION,,} =~ ^(yes|y)$ ]]; then exit 1 else - mkdir ${BACKUP_LOCATION} + mkdir -p ${BACKUP_LOCATION} chmod 755 ${BACKUP_LOCATION} fi else