securityonion
securityonion copied to clipboard
FIX: Many scripts run by cron overwrite their logfile
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.