Hi to all,
I’ve set up
admin_email into my server configuration to get log emails, but every day I get useless emails from
cron.daily that says me that
logrotate has reopened the logs. Is there a way to reduce the number of emails I get from all my servers every day? Maybe setting a log level variable to warning/error.
The 3rd party logrotate role doesn’t appear to have any option built in for managing cron notifications. The closest discussion I found at that project after hasty search was https://github.com/nickhammond/ansible-logrotate/pull/7
Trellis doesn’t yet accommodate adjustments to applications’ built-in cron at this point, so I think it’s up to you to make adjustments at this point. Perhaps you’d decide to write a cron task to override the default logrotate cron, redirecting stdout (and stderr?) to
/dev/null like docs example:
job: "ls -alh > /dev/null".
Note this concept:
Cron will attempt to send an email with any output that may have occurred when the command was run… So to disable it for a specific crontab entry just capture all of the commands output and either direct it to a file or to /dev/null. – ref
Maybe someone else will have better guidance or info.
Thank you! Very helpful, I’ll look into it. Anyway, it’s annoying that the 3rd party logrotate role doesn’t have a built-in option to manage the log level for email notifications.