You are not logged in.
Hi...
I added a job for a daily btrfs scrub to /etc/anacrontab
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=30
# the jobs will be started during the following hours only
#START_HOURS_RANGE=0-24
#period in days delay in minutes job-identifier command
1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
1 0 daily-scrub btrfs scrub start /...and i assumed that removing the "MAILTO=" line is enough to stop anacron mails (at least all documentation i found implied you have to configure mailing AND add MAILTO=<address> to enable mailing).
But instead i now get a daily error:
journalctl output:
anacron[2255]: Tried to mail output of job `daily-scrub', but mailer process (/usr/sbin/sendmail) exited with status 65Of course I could just ignore the error, redirect the output, remove msmtp (which successfully stops anacron from trying to send a mail) or configure anacron mailing to then ignore the email...
But why is anacron even trying to send a mail and isn't there a "clean" way to disable it?
Last edited by Ooops (2020-06-17 22:46:09)
Offline
The documentation leads me to believe otherwise.
If a job generates any output on its standard output or standard error, the output is mailed to the user running Anacron (usually root), or to the address contained by the MAILTO environment variable in the crontab, if such exists. If the LOGNAME environment variable is set, it will be used as From: field.
Offline
Thanks... Not the answer i hoped for but the "[...]mailed to the user running Anacron (usually root), or to the address contained by the MAILTO environment variable in the crontab, if such exists" part got me thinking.
Looks like not adding a MAILTO variable was the completely wrong idea...
MAILTO="" on the other hand seems to have solved my problem and stopped anacron from trying (and failing...) to send mails.
Last edited by Ooops (2020-06-17 22:45:19)
Offline