B2_Command_Line_Tool
B2_Command_Line_Tool copied to clipboard
Add rm cmd
Resolving improvement suggestion: Backblaze/B2_Command_Line_Tool#165
Added 'rm' cmdline command to easily remove files on the remote side - in the bucket. Globs are used to define patterns of the files to remove.
People are going to love this feature!
I think the names rm
and erm
are a little subtle. We don't want to make it too easy for people to accidentally delete all their files. I'd like to suggest an alternative command-line syntax:
b2 rm [--report] [--versions] [--glob] [--regex] <bucketName> <thing_to_delete> ...
Without either option, it would delete only exact matches, and won't delete all files. With either --glob
or --regex
, it would do the kind of matching specified. You would have to go to a little effort to delete all files.
Nice seeing this finally implemented! I think a --dryRun
option, just like for sync, makes sense here. Otherwise there is no real way to test your glob/regex. Or alternatively have the ls
support the same kind of filtering.
@krzysztofgromadzki - Are you interested in making the changes to the command-line syntax?
I like the suggestion of a --dryRun
option.
The other thing that would be good, but is less urgent, is a --threads
option to specify the number of threads do to the deletion work.
@bwbeach I've already started it. I'll change command-line syntax and add --dry
and --threads
flags.
Any updates on this? As a potential customer and speaking on behalf of my employer, I'd love to see it.
This has been abandoned months ago, nobody is working on it
@ppolewicz This is still very much needed, very unfortunate, that it wasn't merged. Even something simple to just delete one file would be great!
@ppolewicz Who owns the abandoned code here? I'm wondering about pushing it to the finish line sometime.
I reviewed it and a surprisingly good chunk of it can be salvaged, though some of it needs to land in b2-sdk-python. @metadaddy where you thinking about finishing it yourself or should I assign someone to do it?
I was thinking of adopting it myself, but if you have someone that can work on it, @ppolewicz, it would happen faster!
all right, I found someone to do it
Superseded by #849