Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dry-run option to generate a list of files that would be removed #72

Open
atc0005 opened this issue Oct 23, 2019 · 2 comments
Open

Comments

@atc0005
Copy link
Owner

atc0005 commented Oct 23, 2019

This is already listed at DEBUG log level, so this option would be enabling reporting of eligible files in some sort of format that is easily read and shared (e.g., logged to a ticket of some kind).

Example/concept usage:

sudo ./elbow --paths /var/log/tomcat7/ --recurse --age 120 --generate-report

Regarding an output format, I'm not sure what would work best. Hopefully something concise for the screen and something else to be saved in a file for later review.

@atc0005
Copy link
Owner Author

atc0005 commented Oct 24, 2019

Note: I need to think of the scope as being over a thousand files.

When I ran this recently against a box with a logrotate misconfiguration (thanks Nagios) a little over 1500 files were removed. I would like to see that list, but not directly on the console, at least not one file per line and certainly not twice as the v0.5.0 release is doing.

@atc0005
Copy link
Owner Author

atc0005 commented Nov 13, 2019

I saw an example earlier today of using tabwriter to build a formatted table. I could try the same approach for listing pruned files.

https://golang.org/pkg/text/tabwriter/

@atc0005 atc0005 self-assigned this Nov 13, 2019
@atc0005 atc0005 pinned this issue Nov 13, 2019
@atc0005 atc0005 changed the title Add option to generate a list of files that would be removed Add dry-run option to generate a list of files that would be removed Jan 16, 2020
@atc0005 atc0005 unpinned this issue Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant