Allow restores of just selected files/directories.
[cumulus.git] / scandir.cc
index 9727133..65151bc 100644 (file)
@@ -189,7 +189,7 @@ int64_t dumpfile(int fd, dictionary &file_info, const string &path,
                 ref = ObjectReference(ObjectReference::REF_ZERO);
                 ref.set_range(0, bytes);
             } else {
-                ObjectReference ref = db->FindObject(block_csum, bytes);
+                ref = db->FindObject(block_csum, bytes);
             }
 
             // Store a copy of the object if one does not yet exist
@@ -565,7 +565,8 @@ void usage(const char *program)
         "                       program though which to filter descriptor\n"
         "  --scheme=NAME        optional name for this snapshot\n"
         "  --intent=FLOAT       intended backup type: 1=daily, 7=weekly, ...\n"
-        "                           (defaults to \"1\")\n",
+        "                           (defaults to \"1\")\n"
+        "  --full-metadata      do not re-use metadata from previous backups\n",
         lbs_version, program
     );
 }
@@ -587,6 +588,7 @@ int main(int argc, char *argv[])
             {"scheme", 1, 0, 0},            // 5
             {"signature-filter", 1, 0, 0},  // 6
             {"intent", 1, 0, 0},            // 7
+            {"full-metadata", 0, 0, 0},     // 8
             {NULL, 0, 0, 0},
         };
 
@@ -627,6 +629,9 @@ int main(int argc, char *argv[])
                 if (snapshot_intent <= 0)
                     snapshot_intent = 1;
                 break;
+            case 8:     // --full-metadata
+                flag_full_metadata = true;
+                break;
             default:
                 fprintf(stderr, "Unhandled long option!\n");
                 return 1;
@@ -785,6 +790,7 @@ int main(int argc, char *argv[])
     fprintf(descriptor, "Date: %s\n", desc_buf);
     if (backup_scheme.size() > 0)
         fprintf(descriptor, "Scheme: %s\n", backup_scheme.c_str());
+    fprintf(descriptor, "Backup-Intent: %g\n", snapshot_intent);
     fprintf(descriptor, "Root: %s\n", backup_root.c_str());
 
     SHA1Checksum checksum_csum;