X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=scandir.cc;h=65151bca1afbe620b594d3ba4834935639d81617;hb=e29cf5eefb0ff3be77a548edb6bbd89ea58c02a9;hp=f653f4335d9ab69e7fff9c66a49669844fd39670;hpb=cc2d3611ed50f5965a9138ffaf3262417993c4f8;p=cumulus.git diff --git a/scandir.cc b/scandir.cc index f653f43..65151bc 100644 --- a/scandir.cc +++ b/scandir.cc @@ -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 @@ -228,6 +228,7 @@ int64_t dumpfile(int fd, dictionary &file_info, const string &path, o->write(tss); ref = o->get_ref(); db->StoreObject(ref, block_csum, bytes, block_age); + ref.set_range(0, bytes); delete o; } @@ -564,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 ); } @@ -586,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}, }; @@ -626,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; @@ -784,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;