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 flag to expose removed files listing currently exposed by default #358

Open
atc0005 opened this issue Oct 18, 2021 · 0 comments
Open
Assignees
Labels
config enhancement New feature or request logging
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Oct 18, 2021

Command and output from some work today to cleanup the /var/log/usage path on a server I'm helping to maintain:

$ sudo ./elbow-v0.7.15-0-g8844f4d-linux-amd64 --use-syslog --paths /var/log/usage/ --age 90 --remove
INFO[0000] Syslog logging requested, attempting to enable it  line=129 use_syslog=true
INFO[0000] Connected to syslog socket
INFO[0000] Starting evaluation of paths list             extensions="[]" file_age=90 file_age_threshold="2021-07-20T16:15:54-05:00" file_pattern= paths="[/var/log/usage/]"
INFO[0000] Beginning processing of path "/var/log/usage/" (1 of 1)  ignore_errors=false iteration=1 total_paths=1
INFO[0000] 2879 files eligible for removal (4.5 GiB)     extensions="[]" file_age=90 file_age_threshold="2021-07-20T16:15:54-05:00" file_pattern= iteration=1 path=/var/log/usage/ total_file_size=4796149148
INFO[0000] 0 files to keep as requested                  iteration=1 keep_oldest=false
INFO[0000] Ignoring file removal errors: false
INFO[0003] 2879 files successfully removed (4.5 GiB)

...

INFO[0003] 0 files failed to remove (0 B)
INFO[0003] Ending processing of path "/var/log/usage/" (1 of 1)  ignore_errors=false iteration=1 total_paths=1
INFO[0003] Elbow successfully completed.                 eligible_remove=2879 eligible_size="4.5 GiB" failed_removed=0 failed_size="0 B" success_removed=2879 success_size="4.5 GiB"

The ... line represents nearly 3,000 files removed and listed in the output. This should probably be hidden by default, but exposed when explicitly requested. Perhaps --list-removed-files or --show-removed.

@atc0005 atc0005 added enhancement New feature or request config logging labels Oct 18, 2021
@atc0005 atc0005 added this to the Future milestone Oct 18, 2021
@atc0005 atc0005 self-assigned this Oct 18, 2021
@atc0005 atc0005 changed the title Add flag to expose remove files listing currently exposed by default Add flag to expose removed files listing currently exposed by default Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config enhancement New feature or request logging
Projects
None yet
Development

No branches or pull requests

1 participant