doc: restore: simplify restore target name

the suffix "-work" is visually distracting since it copies a part of the
directory path being restored.  this makes it easy to gloss over where
the "work" string actually comes from.  as a bonus, it makes the examples
slightly shorter to read.
This commit is contained in:
Kjetil Torgrim Homme
2025-12-05 18:07:11 +01:00
parent 655e527765
commit ee099e4662
+17 -17
View File
@@ -19,13 +19,13 @@ Restoring from a snapshot
Restoring a snapshot is as easy as it sounds, just use the following
command to restore the contents of the latest snapshot to
``/tmp/restore-work``:
``/tmp/restore``:
.. code-block:: console
$ restic -r /srv/restic-repo restore 79766175 --target /tmp/restore-work
$ restic -r /srv/restic-repo restore 79766175 --target /tmp/restore
enter password for repository:
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore-work
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore
Use the word ``latest`` to restore the last backup. You can also combine
``latest`` with the ``--host`` and ``--path`` filters to choose the last
@@ -33,22 +33,22 @@ backup for a specific host, path or both.
.. code-block:: console
$ restic -r /srv/restic-repo restore latest --target /tmp/restore-art --path "/home/art" --host luigi
$ restic -r /srv/restic-repo restore latest --target /tmp/restore --path "/home/art" --host luigi
enter password for repository:
restoring <Snapshot of [/home/art] at 2015-05-08 21:45:17.884408621 +0200 CEST> to /tmp/restore-art
restoring <Snapshot of [/home/art] at 2015-05-08 21:45:17.884408621 +0200 CEST> to /tmp/restore
The files will be restored to ``/tmp/restore-art/home/art``.
The files will be restored to ``/tmp/restore/home/art``.
Use ``--exclude`` and ``--include`` to restrict the restore to a subset of
files in the snapshot. For example, to restore a single file:
.. code-block:: console
$ restic -r /srv/restic-repo restore 79766175 --target /tmp/restore-work --include /work/foo
$ restic -r /srv/restic-repo restore 79766175 --target /tmp/restore --include /work/foo
enter password for repository:
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore-work
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore
This will restore the file ``/work/foo`` to ``/tmp/restore-work/work/foo``.
This will restore the file ``/work/foo`` to ``/tmp/restore/work/foo``.
To only restore a specific subfolder, you can use the ``<snapshot>:<subfolder>``
syntax, where ``snapshot`` is the ID of a snapshot (or the string ``latest``)
@@ -58,11 +58,11 @@ to ``subfolder``.
.. code-block:: console
$ restic -r /srv/restic-repo restore 79766175:/work --target /tmp/restore-work --include /foo
$ restic -r /srv/restic-repo restore 79766175:/work --target /tmp/restore --include /foo
enter password for repository:
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore-work
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore
This will restore the file ``/work/foo`` to ``/tmp/restore-work/foo``.
This will restore the file ``/work/foo`` to ``/tmp/restore/foo``.
You can use the command ``restic ls latest`` or ``restic find foo`` to find the
path to the file within the snapshot. This path you can then pass to
@@ -103,9 +103,9 @@ user and security namespaced extended attributes for files:
.. code-block:: console
$ restic -r /srv/restic-repo restore 79766175 --target /tmp/restore-work --include-xattr user.* --include-xattr security.*
$ restic -r /srv/restic-repo restore 79766175 --target /tmp/restore --include-xattr user.* --include-xattr security.*
enter password for repository:
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore-work
restoring <Snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST> to /tmp/restore
Restoring in-place
------------------
@@ -156,8 +156,8 @@ file with the same name.
When specifying ``--include`` or ``--exclude`` options, only files or directories matched by those
options will be deleted. For example, the command
``restic -r /srv/restic-repo restore 79766175:/work --target /tmp/restore-work --include /foo --delete``
would only delete files within ``/tmp/restore-work/foo``.
``restic -r /srv/restic-repo restore 79766175:/work --target /tmp/restore --include /foo --delete``
would only delete files within ``/tmp/restore/foo``.
When using ``--target / --delete`` then the ``restore`` command only works if either an ``--include``
or ``--exclude`` option is also specified. This ensures that one cannot accidentally delete
@@ -173,7 +173,7 @@ restored files when specifying ``--verbose=2``.
.. code-block:: console
$ restic restore --target /tmp/restore-work --dry-run --verbose=2 latest
$ restic restore --target /tmp/restore --dry-run --verbose=2 latest
unchanged /restic/internal/walker/walker.go with size 2.812 KiB
updated /restic/internal/walker/walker_test.go with size 11.143 KiB