Selaa lähdekoodia

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.
Alice Ferrazzi 6 vuotta sitten
vanhempi
sitoutus
5a56965a48
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      helper-scripts/backup_and_restore.sh

+ 1 - 1
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