ソースを参照

no backup if path is empty

Wolfgang Ortmann 7 年 前
コミット
724b4d31ba
4 ファイル変更12 行追加3 行削除
  1. BIN
      bin/kind
  2. 7 1
      src/excludetools.cpp
  3. 1 1
      src/filetools.cpp
  4. 4 1
      src/kind.ag

BIN
bin/kind


+ 7 - 1
src/excludetools.cpp

@@ -58,7 +58,13 @@ Strings getExclusions(const KindConfig& conf)
           int rc;
           Strings excludes2 = remoteExec(rshCommand, getExcludeFileCommand, rc, debug);
           if (rc == 0)
-            exclusions += excludes2;
+            {
+              for (string s : excludes2)
+                {
+                  if (s[0] != '#')
+                    exclusions += s;
+                }
+            }
         } // if (shellMode)
 
     }

+ 1 - 1
src/filetools.cpp

@@ -262,7 +262,7 @@ Strings localExec(const std::string& cmd,
   if (log.is_open())
     {
       log << "--------------------------------------------------------" << std::endl;
-      log << "pclose result: " << rc << std::endl;
+      log << "rsync exit value: " << rc << std::endl;
     }
   return res;
 }

+ 4 - 1
src/kind.ag

@@ -433,6 +433,9 @@ bool backupVault(const string& vault,
 
       bool backupNow = true;
 
+      if (conf.getString("path").empty()) // empty path string disables backup
+	backupNow = false;
+
       // existing images
       Images validImageList = findImages(vaultPath, conf, false);
       string currentSet = "expire"; // we are not using backupSets
@@ -443,7 +446,7 @@ bool backupVault(const string& vault,
       vector<SetRule> backupSetRule;
       int setRuleIdx = -1;
 
-      if (conf.getBool("useBackupSet"))
+      if (conf.getBool("useBackupSet") && backupNow)
         {
           readSetRules(conf, setIdx, backupSetRule);
           if (!setIdx.empty())