Browse Source

don't backup non-existent directories

Bob Mottram 9 years ago
parent
commit
22cd2dda75
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      src/freedombone

+ 5
- 0
src/freedombone View File

2416
 }
2416
 }
2417
 
2417
 
2418
 function backup_directory_to_usb {
2418
 function backup_directory_to_usb {
2419
+  if [ ! -d ${1} ]; then
2420
+      echo "WARNING: directory does not exist: ${1}"
2421
+      return
2422
+  fi
2423
+
2419
   if [[ $BACKUP_TYPE == 'obnam' ]]; then
2424
   if [[ $BACKUP_TYPE == 'obnam' ]]; then
2420
       BACKUP_KEY_EXISTS=$(gpg --list-keys "$MY_NAME (backup key)")
2425
       BACKUP_KEY_EXISTS=$(gpg --list-keys "$MY_NAME (backup key)")
2421
       if [ ! "$?" = "0" ]; then
2426
       if [ ! "$?" = "0" ]; then