ソースを参照

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