rewrite documentation - explain handling of empty subdirectories

Added a paragraph about the handling of empty subdirectories for
the `--include` variants.
This commit is contained in:
Winfried Plappert 2025-02-19 07:37:16 +00:00
parent 210447ffcc
commit 0a6818cd7a
1 changed files with 13 additions and 0 deletions

View File

@ -329,6 +329,19 @@ The options ``--exclude``, ``--exclude-file``, ``--iexclude`` and
``--iexclude-file`` are supported. They behave the same way as for the backup
command, see :ref:`backup-excluding-files` for details.
The options ``--include``, ``--include-file``, ``--iinclude`` and
``--iinclude-file`` are supported as well.
The ``--include`` variants allow you to reduce an exsiting snapshot or a set of snapshots
to those files which your are really interested in. An example could be all pictures
files from a snapshot:
``restic rewrite -r ... --iinclude "*.jpg" --iinclude "*.jpeg" --iinclude "*.png"``.
Empty subdirectories however will always be preserved.
Totally empty subdirectories (apart from genuine ones)
which have been completey evacuated will not be stored in the new snapshot.
If you specify an ``--include`` pattern which will not include anything useful, you will still
create a new snapshot if the original snapshot contained one or more empty subdirectories.
It is possible to rewrite only a subset of snapshots by filtering them the same
way as for the ``copy`` command, see :ref:`copy-filtering-snapshots`.