From d34ba9b6bdd421cb0d0f0d955f3cdf6b397c51d7 Mon Sep 17 00:00:00 2001 From: Kjetil Torgrim Homme Date: Fri, 5 Dec 2025 17:59:56 +0100 Subject: [PATCH] doc: restore: explain how --delete and --exclude work together --- doc/050_restore.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/050_restore.rst b/doc/050_restore.rst index 745cb165a..5e91fdf75 100644 --- a/doc/050_restore.rst +++ b/doc/050_restore.rst @@ -136,6 +136,14 @@ files that do not exist in the snapshot. For this, pass the ``--delete`` option command. The command will then **delete all files** from the target directory that do not exist in the snapshot. +With ``--delete``, ``--exclude`` has a dual purpose: + +* It will exclude files from being restored. The exclude argument is taken + relative to the subfolder given with the snapshot (if any; otherwise ``/`` of + the snapshot.) +* It will exclude files in the target directory from being deleted. The exclude + argument is here relative to the target directory. + The ``--delete`` option also allows overwriting a non-empty directory if the snapshot contains a file with the same name.