Brad Fitzpatrick


Brackup::DigestCache - cache digests of file and chunk contents


The brackup DigestCache caches the digests (currently SHA1) of files and file chunks, to prevent untouched files from needing to be re-read on subsequent, iterative backups.

The digest cache is purely a cache. It has no critical data in it, so if you lose it, subsequent backups will just take longer while the digest cache is re-built.

Note that you don't need the digest cache to do a restore.


Storage type

The digest cache makes use of Dictionary modules (Brackup::Dict::*) to handle the storage of the cache. The default dictionary used is Brackup::Dict::SQLite, which stores the cache as an SQLite database in a single file. The schema is created automatically as needed... no database maintenance is required.

The dictionary type can be specified in the [SOURCE] declaration in your brackup.conf file, using the 'digestdb_type' property e.g.:

  path = /home/bradfitz/
  # specify the lighter/slower Brackup::Dict::SQLite2 instead of the default
  digestdb_type = SQLite2

File location

The cache database file is stored in either the location specified in a Brackup::Root's [SOURCE] declaration in ~/.brackup.conf, as:

  path = /home/bradfitz/
  # be explicit if you want:
  digestdb_file = /var/cache/brackup-brad/digest-cache-bradhome.db

Or, more commonly (and recommended), is to not specify it and accept the default location, which is ".brackup-digest.db" in the root's root directory.

  path = /home/bradfitz/
  # this is the default:
  # digestdb_file = /home/bradfitz/.brackup-digest.db

Keys & Values stored in the cache

Files digests keys (see Brackup::File)


Chunk digests keys (see Brackup::PositionedChunk)



In both cases, the values are the digest of the chunk/file, in form: