Selaa lähdekoodia

don't backup non-existent directories

Bob Mottram 9 vuotta sitten
vanhempi
commit
22cd2dda75
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5
    0
      src/freedombone

+ 5
- 0
src/freedombone Näytä tiedosto

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