btrfs-progs
btrfs-progs copied to clipboard
an option to btrfs-restore exclude paths matching a pattern (e.g., Trash)
(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.
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.
So no way to exclude paths yet?
really? 8y later still no fix for this?