How to get rid of mail message?

Bo Berglund bo.berglund at gmail.com
Fri Feb 25 16:55:28 UTC 2022


On Fri, 25 Feb 2022 16:35:40 +0000, Colin Law <clanlaw at gmail.com> wrote:

>On Fri, 25 Feb 2022 at 16:32, Colin Law <clanlaw at gmail.com> wrote:
>>
>> On Fri, 25 Feb 2022 at 16:31, Colin Law <clanlaw at gmail.com> wrote:
>> >
>> > On Fri, 25 Feb 2022 at 15:45, Bo Berglund <bo.berglund at gmail.com> wrote:
>> > >
>> > > I have started to see a pop-up message in my terminal with the following text:
>> > >
>> > > You have new mail in /var/mail/<username>
>> > >
>> > > If I look at this (it is actually not an  email, it is just a text file) it
>> > > seems to contain output from an application which is scheduled to run hourly by
>> > > at.
>> >
>> > It sounds like they may be cron emailing you (which is the default).
>> > This is what I did to stop that (though I was just following something
>> > I found somewhere so it may not be the best way, or may be out of
>> > date.
>> > Edit /etc/rsyslog.conf and add ,cron.none to these two lines so you have
>> >
>> > auth,authpriv.*,cron.none                      /var/log/auth.log
>> > *.*;auth,authpriv.none,cron.none               -/var/log/syslog
>>
>> Ah, no, that was to stop cron logging, obviously.  Will have another
>> look at my notes.
>
>This is it I think. It is just a matter of redirecting the output to
>null in the cron command.
>https://www.cyberciti.biz/faq/disable-the-mail-alert-by-crontab-command/
>

THanks!
I will try this. Easy for cron jobs but harder for scripts started by at...
There are a lot of scripts involved, do I have to edit all of them to redirect
the output?
The at commands are pretty complex (generated by another script) but I will have
a look at it.


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list