You are here
NeODarK - Wed, 2022/09/28 - 14:42
Hi, I have some machines with Turnkey Linux and I receive all days cron apt emails about updates...
How I can disable this emails but still receiving any error update email?
Thanks!!
Forum:
Apologies on my slow response...
Apologies on my slow response... I'm not sure how or why, but it appears that I missed your post. Apologies about that.
To be honest, I'm not 100% sure about achieving your ends. As you note, we use cron-apt. The actual cron job that get's triggered is /etc/cron.daily/apt-compat, which then in turn triggers /usr/lib/apt/apt.systemd.daily to actually check for updates and install them.
So my guess is that to only get emails for errors, you want to change the last line in /etc/cron.daily/apt-compat so that stdout (normal output) is suppressed. That should mean that no email is sent, unless there is output to stderr (error output). I'm not 100% sure it'll work so you'll need to test.
For testing, moving the jo0b (temporarily) to hourly might tighten up the feedback look a bit (creating a cron job to run every minute is probably even better, but not quite as simple to configure, so I'll leave that for you).
Then edit the last line from this (what it should look like by default):
To this:
Hopefully that does the trick. If not, please post back and I'll have a bit more of a dig myself.
I have tried this editing the
I have tried this editing the last line, but I still receive the same emails daily. Do you have another suggestion?
It should only forward error messages?!
The line I've shared above should trap stdout (standard output) and only forward stderr (standard error). That's not 100% infallible, but generally should ensure that there is only error message output.
So if you are getting emails (and my initial understanding is correct), they should be documenting some sort of error or warning message. Is that the case?
Perhaps manually run 'apt update" to ensure that there aren't any warning or errors. Also, could you please share the text of one of the messages?
It should only forward error
It should only forward error messages?!
Jeremy Davis - Tue, 2023/01/17 - 04:58
The line I've shared above should trap stdout (standard output) and only forward stderr (standard error). That's not 100% infallible, but generally should ensure that there is only error message output.
So if you are getting emails (and my initial understanding is correct), they should be documenting some sort of error or warning message. Is that the case?
Perhaps manually run 'apt update" to ensure that there aren't any warning or errors. Also, could you please share the text of one of the messages?
thanks my issue has been fixed.
The line I've shared above
The line I've shared above should trap stdout (standard output) and only forward stderr (standard error). That's not 100% infallible, but generally should ensure that there is only error message output.
So if you are getting emails (and my initial understanding is correct), they should be documenting some sort of error or warning message. Is that the case?
Perhaps manually run 'apt update" to ensure that there aren't any warning or errors. Also, could you please share the text of one of the messages.
thanks for the awesome information.
thanks my issue has been fixed.
Email message example
Here is email I get as example. There is no error stated
Did you change the line as suggested?
Did you change the file as suggested in my previous post?
I.e. change the last line of /etc/cron.daily/apt-compat to:
If not, please apply that change and then see how it goes. If it works, it'd be great if you could confirm. If you are still getting messages after making the change, then please post back.
Still not working
Add new comment