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

FIX: Many scripts run by cron overwrite their logfile #12945

Open
petiepooo opened this issue May 6, 2024 · 1 comment
Open

FIX: Many scripts run by cron overwrite their logfile #12945

petiepooo opened this issue May 6, 2024 · 1 comment

Comments

@petiepooo
Copy link
Contributor

Many scripts run by cron, such as so-rule-update and so-elasticsearch-indices-delete, overwrite their logfile on each run, so a history of what the script has done is lost. Changing the redirect from '>' to '>>' means historical runs will remain in the logfile. Furthermore, the bash-ism '&>>' redirects for stdout and stderr, eliminating the need for the separate '2>&1'.

See #12943 for proposed fix.

Note: this does not address retention and rotation of these logfiles. With them growing in size after this patch, they could get large quickly if not rotated regularly.

@petiepooo
Copy link
Contributor Author

Are the elasticsearch and idstools patch still useful? I haven't found where logs from so-elasticsearch-indices-delete-delete or logs from so-rule-update are saved.

I can resubmit a PR with just those two commits if you'd like, but I'm not sure even that would log anything for so-elasticsearch-indices-delete-delete.

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

No branches or pull requests

1 participant