[GH-ISSUE #557] [feat request] option to ignore/include files using rsync-filter syntax #241

Open
opened 2026-06-08 11:26:18 +03:00 by zhus · 2 comments
Owner

Originally created by @renatocoutinho on GitHub (Jan 16, 2026).
Original GitHub issue: https://github.com/bootandy/dust/issues/557

The idea is to add the ability to pass "-F .rsync-filter" and have it ignore the files inside (using rsync's syntax). The rsync syntax could probably be rewritten as a big (set of) regex.

Reasoning: I often use dust prior to backing up messy directories with rsync, and exclude some files/dirs using rsync filters, then I re-run dust excluding all those files/dirs by hand - if dust had this feature, the process would be a lot easier.

rsync does something more complicated with only "-F" which is to recursively check for .rsync-filter in every sub-folder, that does look more complicated to implement.

Originally created by @renatocoutinho on GitHub (Jan 16, 2026). Original GitHub issue: https://github.com/bootandy/dust/issues/557 The idea is to add the ability to pass "-F .rsync-filter" and have it ignore the files inside (using rsync's syntax). The rsync syntax could probably be rewritten as a big (set of) regex. Reasoning: I often use dust prior to backing up messy directories with rsync, and exclude some files/dirs using rsync filters, then I re-run dust excluding all those files/dirs by hand - if dust had this feature, the process would be a lot easier. rsync does something more complicated with only "-F" which is to recursively check for .rsync-filter in every sub-folder, that does look more complicated to implement.
Author
Owner

@bootandy commented on GitHub (Feb 21, 2026):

  -I, --ignore-all-in-file <FILE>
          Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter

Can you make this work with the existing above flag -I ?

-I is like -v only it will take a file which can contain multiple regex.

Or perhaps you want to use -v "\.rsync-filter - which will ignore files in the .rsync-filter directory.

<!-- gh-comment-id:3938958541 --> @bootandy commented on GitHub (Feb 21, 2026): ``` -I, --ignore-all-in-file <FILE> Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter ``` Can you make this work with the existing above flag -I ? -I is like -v only it will take a file which can contain multiple regex. Or perhaps you want to use ` -v "\.rsync-filter` - which will ignore files in the .rsync-filter directory.
Author
Owner

@renatocoutinho commented on GitHub (Feb 21, 2026):

No, the syntax is quite different. For instance, to exclude a folder foo in the top dir with rsync-filter I use

- /foo

and this is not recognized by dust. I could try and change this to just

foo

but now this excludes any files or folder that contain "foo" in the name, and something like

^foo$

doesn't work at all! (by the way, this doesn't work even with -v on the command line, I think this is probably a bug? Will re-read docs and search for issues before filling a new issue later)

<!-- gh-comment-id:3939262513 --> @renatocoutinho commented on GitHub (Feb 21, 2026): No, the syntax is quite different. For instance, to exclude a folder `foo` in the top dir with rsync-filter I use ``` - /foo ``` and this is not recognized by dust. I could try and change this to just ``` foo ``` but now this excludes any files or folder that contain "foo" in the name, and something like ``` ^foo$ ``` doesn't work at all! (by the way, this doesn't work even with -v on the command line, I think this is probably a bug? Will re-read docs and search for issues before filling a new issue later)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#241