That section was poorly phrased. I tried to find another reference that spells it out as clearly, without success. So, in a moment of weakness, I entered the following string in Google Search:
linux rsync using no other delete flags, does "--delete-excluded" delete files other than under the specified directory
Response offered by Google AI
AI Overview
No, the --delete-excluded flag only deletes files and directories located under the specified destination directory.
It does not impact files outside the target path of the rsync command. [1]
How it Works
When you use --delete-excluded, rsync applies your exclude rules to the destination. If a file or folder exists at the destination but matches an exclude pattern, rsync will remove it even if it is still present at the source.
-
Scope: It only scans and acts upon the “receiving side” directories that are actively being synchronized.
-
Interaction with
--delete: While--deleteremoves files that no longer exist at the source, it typically protects files that you have explicitly excluded. Adding--delete-excludedoverrides this protection, forcing the removal of any destination files matching your exclude list.
That explanation is how I understand the separation of scope between
- group 1 { --del | --delete | --delete-before | --delete-during | --delete-delay | --delete-after }
and
- group 2 { --delete-excluded } ,
where this last is in a group of its own for actions that act on a file grouping which is exclusively outside the scope of the intended search tree(s).