diff --git a/doc/040_backup.rst b/doc/040_backup.rst index b01683929..f56610507 100644 --- a/doc/040_backup.rst +++ b/doc/040_backup.rst @@ -451,6 +451,15 @@ and displays a small statistic, just pass the command two snapshot IDs: Added: 16.403 MiB Removed: 16.402 MiB +To only compare files in specific subfolders, you can use the ``:`` +syntax, where ``snapshot`` is the ID of a snapshot or ``latest`` and ``subfolder`` +is a path within the snapshot. For example, to only compare files in the ``/restic`` +folder, you could use the following command: + +.. code-block:: console + + $ restic -r /srv/restic-repo diff 5845b002:/restic 2ab627a6:/restic + Backing up special items and metadata ************************************* diff --git a/doc/050_restore.rst b/doc/050_restore.rst index 47a1be003..e9fa4e327 100644 --- a/doc/050_restore.rst +++ b/doc/050_restore.rst @@ -48,6 +48,18 @@ files in the snapshot. For example, to restore a single file: This will restore the file ``foo`` to ``/tmp/restore-work/work/foo``. +To only restore a specific subfolder, you can use the ``:`` +syntax, where ``snapshot`` is the ID of a snapshot or ``latest`` and ``subfolder`` +is a path within the snapshot. + +.. code-block:: console + + $ restic -r /srv/restic-repo restore 79766175:/work --target /tmp/restore-work --include /foo + enter password for repository: + restoring to /tmp/restore-work + +This will restore the file ``foo`` to ``/tmp/restore-work/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 ``--include`` in verbatim to only restore the single file or directory. @@ -151,8 +163,14 @@ output the contents in the tar (default) or zip format: .. code-block:: console $ restic -r /srv/restic-repo dump latest /home/other/work > restore.tar - + .. code-block:: console $ restic -r /srv/restic-repo dump -a zip latest /home/other/work > restore.zip +The folder content is then contained at ``/home/other/work`` within the archive. +To include the folder content at the root of the archive, you can use the ``:`` syntax: + +.. code-block:: console + + $ restic -r /srv/restic-repo dump latest:/home/other/work / > restore.tar