Skip to content

Refactor clean_loglogins script#671

Open
pmeulen wants to merge 4 commits into
mainfrom
feature/refactor_log_logins_cleanup_script
Open

Refactor clean_loglogins script#671
pmeulen wants to merge 4 commits into
mainfrom
feature/refactor_log_logins_cleanup_script

Conversation

@pmeulen
Copy link
Copy Markdown
Member

@pmeulen pmeulen commented May 12, 2026

  • Assign all Jina2 parameters to BASH variables and use from there
  • Move magic constants to BASH variables
  • Add --force option
  • Add error handling fo all SQL queries
  • Log when there is no data to delete
  • Log when a mail is sent
  • Log what database is used

- Assign all Jina2 parameters to BASH variables and use from there
- Move magic constants to BASH variables
- Add --force option
- Add error handling fo all SQL queries
- Log when there is no data to delete
- Log when a mail is sent
- Log what database is used
@pmeulen pmeulen self-assigned this May 12, 2026
@pmeulen pmeulen requested a review from Copilot May 12, 2026 11:25
@pmeulen pmeulen requested a review from crosmuller May 12, 2026 11:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the clean_loglogins maintenance script template to centralize configuration in variables, improve logging, and add a --force override for the deletion safety check.

Changes:

  • Refactored the script to use Bash variables for all Jinja2-provided values and “magic constants”.
  • Added --force flag handling to bypass the MAX_DELETE_DAYS safeguard.
  • Added helper functions for logging and mailing, and expanded runtime logging (DB used, no-data cases, mail-sent).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread roles/rsyslog/templates/clean_loglogins.j2 Outdated
Comment on lines +83 to +85
log_message "No logins found in log_logins"
send_mail "No logins found in log_logins"
exit
Comment thread roles/rsyslog/templates/clean_loglogins.j2 Outdated
Comment thread roles/rsyslog/templates/clean_loglogins.j2
Comment thread roles/rsyslog/templates/clean_loglogins.j2 Outdated
pmeulen and others added 3 commits May 12, 2026 13:40
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants