diff --git a/doc/050_restore.rst b/doc/050_restore.rst index 83eec1d38..52a5fc711 100644 --- a/doc/050_restore.rst +++ b/doc/050_restore.rst @@ -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 to /tmp/restore-work + restoring 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 to /tmp/restore-art + restoring 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 to /tmp/restore-work + restoring 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 ``:`` 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 to /tmp/restore-work + restoring 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 to /tmp/restore-work + restoring 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