diff --git a/doc/cache.rst b/doc/cache.rst index b9dbf2797..a39a1e76c 100644 --- a/doc/cache.rst +++ b/doc/cache.rst @@ -19,8 +19,18 @@ a lower version number is found the cache is recreated with the current version. If a higher version number is found the cache is ignored and left as is. -Snapshots and Indexes ---------------------- +Snapshots, Data and Indexes +--------------------------- Snapshot, Data and Index files are cached in the sub-directories ``snapshots``, ``data`` and ``index``, as read from the repository. + +Expiry +------ + +Whenever a cache directory for a repo is used, that directory's modification +timestamp is updated to the current time. By looking at the modification +timestamps of the repo cache directories it is easy to decide which directories +are old and haven't been used in a long time. Those are probably stale and can +be removed. + diff --git a/doc/manual_rest.rst b/doc/manual_rest.rst index a3da3453e..be2e26805 100644 --- a/doc/manual_rest.rst +++ b/doc/manual_rest.rst @@ -280,3 +280,10 @@ entirely. In this case, all data is loaded from the repo. The cache is ephemeral: When a file cannot be read from the cache, it is loaded from the repository. + +Within the cache directory, there's a sub directory for each repository the +cache was used with. Restic updates the timestamps of a repo directory each +time it is used, so by looking at the timestamps of the sub directories of the +cache directory it can decide which sub directories are old and probably not +needed any more. You can either remove these directories manually, or run a +restic command with the ``--cleanup-cache`` flag.