瀏覽代碼

don't backup non-existent directories

Bob Mottram 9 年之前
父節點
當前提交
22cd2dda75
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5
    0
      src/freedombone

+ 5
- 0
src/freedombone 查看文件

@@ -2416,6 +2416,11 @@ function get_mariadb_owncloud_admin_password {
2416 2416
 }
2417 2417
 
2418 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 2424
   if [[ $BACKUP_TYPE == 'obnam' ]]; then
2420 2425
       BACKUP_KEY_EXISTS=$(gpg --list-keys "$MY_NAME (backup key)")
2421 2426
       if [ ! "$?" = "0" ]; then