Added path discrepancy to backup and listing

This commit is contained in:
Markus Kramer 2023-08-16 12:48:22 +02:00
parent 2c37fb27ad
commit d57ef6ec75
3 changed files with 29 additions and 8 deletions

View File

@ -45,6 +45,17 @@ size of the files and directories in ``~/work`` on the local file system. It
also tells us that only 1.200 GiB was added to the repository. This means that
some of the data was duplicate and restic was able to efficiently reduce it.
We just attached the absolute path ``~/work`` to the backup, so the path
within the repository is ``/home/user/work``, depending on your user name.
If we attach a relative path ``work``, the path within the repository is ``/work``.
For example ``restic backup work`` run from ``/home/user`` crates a snapshot
with a attached path ``/home/user/work`` that contains the path ``/work``
within the repository. This path-related discrepancy applies to each command
that tries to access data within a snapshot. You can lookup the paths within
a repository using the ``ls latest /`` command.
If you don't pass the ``--verbose`` option, restic will print less data. You'll
still get a nice live status display. Be aware that the live status shows the
processed files and not the transferred data. Transferred volume might be lower

View File

@ -32,6 +32,9 @@ Now, you can list all the snapshots stored in the repository:
590c8fc8 2015-05-08 21:47:38 kazik /srv
9f0bc19e 2015-05-08 21:46:11 luigi /srv
The Directory column shows the attached path, which may differ
from the path within the repository, see https://restic.readthedocs.io/en/stable/040_backup.html#backing-up for details of this discrepancy.
You can filter the listing by directory path:
.. code-block:: console

View File

@ -156,8 +156,21 @@ e.g.:
$ restic -r /srv/restic-repo dump --path /production.sql latest production.sql | mysql
For a local repository, the "Directory" path can result in the error message ``cannot dump file: path "/home" not found in snapshot``
In this case, you can query the absolute path within the repository using the ```ls`` command:
This example assumes you attached an absolute path, which means it coincides with the
path within the repository.
See https://restic.readthedocs.io/en/stable/040_backup.html#backing-up for the difference
between attached path and path within the repository.
If you attached a relative path, the ``dump`` command would look like:
.. code-block:: console
$ restic -r /srv/restic-repo dump latest /work/README.md
If dump results in the error message ``cannot dump file: path "/home" not found in snapshot``
first double check you used the path within the repository, using the ``ls latest /`` command,
which for the repository above results in:
.. code-block:: console
@ -167,12 +180,6 @@ In this case, you can query the absolute path within the repository using the ``
/work
and use the latter absolute path for the ``dump`` command:
.. code-block:: console
$ restic -r /srv/restic-repo dump latest /work/README.md
It is also possible to ``dump`` the contents of a whole folder structure to
stdout. To retain the information about the files and folders Restic will