From aea7538936316dde8a615b4751d65d873db10ff1 Mon Sep 17 00:00:00 2001 From: Refutable4890 <107740882+Refutable4890@users.noreply.github.com> Date: Wed, 7 Jun 2023 22:35:33 +0800 Subject: [PATCH 1/2] Add an description of `check` temporary cache directory location --- doc/manual_rest.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/manual_rest.rst b/doc/manual_rest.rst index 093144722..b83a152bf 100644 --- a/doc/manual_rest.rst +++ b/doc/manual_rest.rst @@ -418,6 +418,7 @@ instead of the default, set the environment variable like this: $ restic -r /srv/restic-repo backup ~/work +If the environment variable ``$RESTIC_CACHE_DIR`` is not set, ``check`` creates its temporary cache directory in the temporary directory. If ``$RESTIC_CACHE_DIR`` is set, ``check`` creates its temporary cache directory in ``$RESTIC_CACHE_DIR``. .. _caching: From 8dcb0c4a9d830955888aa928fb59533a9fbf71d7 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 17 Jun 2023 15:45:54 +0200 Subject: [PATCH 2/2] doc: improve description of caching behavior of the check command --- doc/045_working_with_repos.rst | 10 ++++++++++ doc/manual_rest.rst | 7 ++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/045_working_with_repos.rst b/doc/045_working_with_repos.rst index 00d87a450..82a20bac4 100644 --- a/doc/045_working_with_repos.rst +++ b/doc/045_working_with_repos.rst @@ -232,6 +232,8 @@ modifying the repository. Instead restic will only print the actions it would perform. +.. _checking-integrity: + Checking integrity and consistency ================================== @@ -284,6 +286,14 @@ If the repository structure is intact, restic will show that no errors were foun check snapshots, trees and blobs no errors were found +By default, check creates a new temporary cache directory to verify that the +data stored in the repository is intact. To reuse the existing cache, you can +use the ``--with-cache`` flag. + +If the cache directory is not explicitly set, then ``check`` creates its +temporary cache directory in the temporary directory, see :ref:`temporary_files`. +Otherwise, the specified cache directory is used, as described in :ref:`caching`. + By default, the ``check`` command does not verify that the actual pack files on disk in the repository are unmodified, because doing so requires reading a copy of every pack file in the repository. To tell restic to also verify the diff --git a/doc/manual_rest.rst b/doc/manual_rest.rst index b83a152bf..71f5e192b 100644 --- a/doc/manual_rest.rst +++ b/doc/manual_rest.rst @@ -418,8 +418,6 @@ instead of the default, set the environment variable like this: $ restic -r /srv/restic-repo backup ~/work -If the environment variable ``$RESTIC_CACHE_DIR`` is not set, ``check`` creates its temporary cache directory in the temporary directory. If ``$RESTIC_CACHE_DIR`` is set, ``check`` creates its temporary cache directory in ``$RESTIC_CACHE_DIR``. - .. _caching: Caching @@ -443,6 +441,10 @@ The command line parameter ``--cache-dir`` or the environment variable parameter ``--no-cache`` disables the cache entirely. In this case, all data is loaded from the repository. +If a cache location is explicitly specified, then the ``check`` command will use +that location to store its temporary cache. See :ref:`checking-integrity` for +more details. + The cache is ephemeral: When a file cannot be read from the cache, it is loaded from the repository. @@ -452,4 +454,3 @@ 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. -