btrfs-progs icon indicating copy to clipboard operation
btrfs-progs copied to clipboard

an option to btrfs-restore exclude paths matching a pattern (e.g., Trash)

Open imz opened this issue 12 years ago • 3 comments

(I first wrote this wish down at https://btrfs.wiki.kernel.org/index.php/Talk:Restore.)

I'm thinking how to exclude paths like .Trash from restoring with a regex.

So, POSIX Extended Regular Expressions are used here. (Which don't have a syntax for the wanted complement operation.)

he simplest solution must be to patch the C code to implement an option like grep's -v (or --invert-match): "Invert the sense of matching, to select non-matching lines." (But "-v" has already been taken as an option of btrfs-restore...) Combining inclusion and exclusion patterns is more complex; which one should take precedence is not a clear thing; ideally, a language like that of "find" should be implemented for matching, but that's too much work. (As for me personally, I'm simply interested in excluding trash directories, and that's achievable with the simplest inversion option.)

Exclusion could be done by a variant of the -m switch, say, -M.

imz avatar Feb 05 '13 21:02 imz

Also reported at https://bugzilla.kernel.org/show_bug.cgi?id=66911 .

Anothe idea: an interactive mode asking for more inclusion and exclusion patterns as new paths are discovered.

imz avatar Dec 12 '13 08:12 imz

So no way to exclude paths yet?

ssorgatem avatar Feb 20 '21 13:02 ssorgatem

really? 8y later still no fix for this?

suvl avatar Nov 03 '21 10:11 suvl