Closed equaeghe closed 4 years ago
I understand that the typo was particularly bad here. However, I mark the issue as "Can't fix", because actually all options which are trivial to check are already checked. To check the validity of the -c argument (which in the example is "-s") is not trivial, and I will not implement it: It requires a dependency to perl's File-Which package (or re-implemention of that package which would be hackish) which IMHO is not acceptable only for a pre-check.
I hope that the loss was not too bad (except for some error messages when attempting to call the (hopefully nonexistent!) binary -s
, the effect should probably have been similar to logclean -c '' logs
).
I can only give the general recommendation to always pass "dry-run"-type arguments first on the command line (also in case a program is really buggy and already does something when evaluating the arguments, usually in-order)
I hope that the loss was not too bad (except for some error messages when attempting to call the (hopefully nonexistent!) binary
-s
, the effect should probably have been similar tologclean -c '' logs
).
I realized soon after creating the issue that I had btrfs snapshots to retrieve everything from. So no, it wasn't bad in the end. (It wouldn't ever have been problematic.)
I executed
logclean -c -s logs
instead oflogclean -c '' -s logs
and unintentionally, all my logs were cleaned. I would like to suggest to first check the options for errors and aborting when they contain errors.Furthermore, no logfiles were retained, not even the most recent one for installed packages. (Only those for logclean and its dependencies.) As far as I could gather, no time-based cleaning should be done by default.