diff --git a/doc/045_working_with_repos.rst b/doc/045_working_with_repos.rst index d5f2240b8..80ee82c6b 100644 --- a/doc/045_working_with_repos.rst +++ b/doc/045_working_with_repos.rst @@ -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`.