github.com/mckael/restic@v0.8.3/doc/cache.rst (about)

     1  Local Cache
     2  ===========
     3  
     4  In order to speed up certain operations, restic manages a local cache of data.
     5  This document describes the data structures for the local cache with version 1.
     6  
     7  Versions
     8  --------
     9  
    10  The cache directory is selected according to the `XDG base dir specification
    11  <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>`__.
    12  Each repository has its own cache sub-directory, consting of the repository ID
    13  which is chosen at ``init``. All cache directories for different repos are
    14  independent of each other.
    15  
    16  The cache dir for a repo contains a file named ``version``, which contains a
    17  single ASCII integer line that stands for the current version of the cache. If
    18  a lower version number is found the cache is recreated with the current
    19  version. If a higher version number is found the cache is ignored and left as
    20  is.
    21  
    22  Snapshots, Data and Indexes
    23  ---------------------------
    24  
    25  Snapshot, Data and Index files are cached in the sub-directories ``snapshots``,
    26  ``data`` and  ``index``, as read from the repository.
    27  
    28  Expiry
    29  ------
    30  
    31  Whenever a cache directory for a repo is used, that directory's modification
    32  timestamp is updated to the current time. By looking at the modification
    33  timestamps of the repo cache directories it is easy to decide which directories
    34  are old and haven't been used in a long time. Those are probably stale and can
    35  be removed.
    36