The map::at method does not always exist, so instead use map::find.
[cumulus.git] / doc / format.txt
index 5c9d5fa..2ab2696 100644 (file)
@@ -1,14 +1,22 @@
                        Backup Format Description
-                  for an LFS-Inspired Backup Solution
-                      Version: "LBS Snapshot v0.6"
+         for Cumulus: Efficient Filesystem Backup to the Cloud
+                      Version: "LBS Snapshot v0.8"
 
-NOTE: This format specification is not yet complete.  Right now the code
-provides the best documentation of the format.
+NOTE: This format specification is intended to be mostly stable, but is
+still subject to change before the 1.0 release.  The code may provide
+additional useful documentation on the format.
+
+NOTE2: The name of this project has changed from LBS to Cumulus.
+However, to avoid introducing gratuitous changes into the format, in
+most cases any references to "LBS" in the format description have been
+left as-is.  The name may be changed in the future if the format is
+updated.
 
 This document simply describes the snapshot format.  It is described
 from the point of view of a decompressor which wishes to restore the
 files from a snapshot.  It does not specify the exact behavior required
-of the backup program writing the snapshot.
+of the backup program writing the snapshot.  For details of the current
+backup program, see implementation.txt.
 
 This document does not explain the rationale behind the format; for
 that, see design.txt.
@@ -17,7 +25,7 @@ that, see design.txt.
 DATA CHECKSUMS
 ==============
 
-In several places in the LBS format, a cryptographic checksum may be
+In several places in the Cumulus format, a cryptographic checksum may be
 used to allow data integrity to be verified.  At the moment, only the
 SHA-1 checksum is supported, but it is expected that other algorithms
 will be supported in the future.
@@ -41,7 +49,7 @@ A sample checksum string is
 SEGMENTS & OBJECTS: STORAGE AND NAMING
 ======================================
 
-An LBS snapshot consists, at its base, of a collection of /objects/:
+A Cumulus snapshot consists, at its base, of a collection of /objects/:
 binary blobs of data, much like a file.  Higher layers interpret the
 contents of objects in various ways, but the lowest layer is simply
 concerned with storing and naming these objects.
@@ -50,9 +58,9 @@ An object is a sequence of bytes (octets) of arbitrary length.  An
 object may contain as few as zero bytes (though such objects are not
 very useful).  Object sizes are potentially unbounded, but it is
 recommended that the maximum size of objects produced be on the order of
-megabytes.  Files of essentially unlimited size can be stored in an LBS
-snapshot using objects of modest size, so this should not cause any real
-restrictions.
+megabytes.  Files of essentially unlimited size can be stored in a
+Cumulus snapshot using objects of modest size, so this should not cause
+any real restrictions.
 
 For storage purposes, objects are grouped together into /segments/.
 Segments use the TAR format; each object within a segment is stored as a
@@ -116,12 +124,35 @@ is invalid to select using the slice syntax a range of bytes that does
 not fall within the original object.  The slice specification should be
 appended to an object name, for example:
     a704eeae-97f2-4f30-91a4-d4473956366b/000001ad[264+1000]
-selects only bytes 264..1263 from the original object.
+selects only bytes 264..1263 from the original object.  As an
+abbreviation, the slice syntax
+    [<length>]
+is shorthand for
+    [0+<length>]
+In place of a traditional slice, the annotation
+    [=<length>]
+may be used.  This is somewhat similar to specifying [<length>], but
+additionally asserts that the referenced object is exactly <length>
+bytes long--that is, this slice syntax does not change the bytes
+returned at all, but can be used to provide information about the
+underlying object store.
 
 Both a checksum and a slice can be used.  In this case, the checksum is
 given first, followed by the slice.  The checksum is computed over the
 original object contents, before slicing.
 
+Special Objects
+---------------
+
+In addition to the standard syntax for objects described above, the
+special name "zero" may be used instead of segment/sequence number.
+This represents an object consisting entirely of zeroes.  The zero
+object must have a slice specification appended to indicate the size of
+the object.  For example
+    zero[1024]
+represents a block consisting of 1024 null bytes.  A checksum should not
+be given.  The slice syntax should use the abbreviated length-only form.
+
 
 FILE METADATA LISTING
 =====================
@@ -249,7 +280,7 @@ is %Y%m%dT%H%M%S (20070806T092239 means 2007-08-06 09:22:39).
 The contents of the descriptor are a set of RFC 822-style headers (much
 like the metadata listing).  The fields which are defined are:
     Format: The string "LBS Snapshot v0.6" which identifies this file as
-        an LBS backup descriptor.  The version number (v0.6) might
+        a Cumulus backup descriptor.  The version number (v0.6) might
         change if there are changes to the format.  It is expected that
         at some point, once the format is stabilized, the version
         identifier will be changed to v1.0.
@@ -270,3 +301,6 @@ like the metadata listing).  The fields which are defined are:
         the snapshot descriptor file, but with extension .sha1sums
         instead of .lbs) containing SHA-1 checksums of all segments.
         This field contains a checksum of that file.
+    Intent: Informational; records the value of the --intent flag when
+        the snapshot was created, and can be used when determining which
+        snapshots to later delete.