You are not logged in.

#1 2011-08-27 15:36:55

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,716
Website

a better may to disable cronie sending mail

I added the following to /etc/conf.d/crond per the man page which stopped most of the mails:

CRONDARGS=-m /dev/null

I still get mails for jobs in /etc/cron.hourly/ so I added the following to /etc/cron.d/0hourly

MAILTO=

Is there a better or more global setting to accomplish this?

EDIT: Solved by switching back to crond and see post #4

Last edited by graysky (2011-10-16 15:36:53)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2011-08-27 16:43:42

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: a better may to disable cronie sending mail

You shouldn't need to do this. What's in the emails?

Consider "> /dev/null" in your cron-run scripts, so they don't output stuff you don't want to see, and hence trigger cron to email it to you in the first place.

Offline

#3 2011-09-20 00:23:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: a better may to disable cronie sending mail

Not sure if it helps but
http://mailman.archlinux.org/pipermail/ … 19661.html

Kaiting Chen wrote:

Scripts in '/etc/cron.hourly' are run directly by `/usr/sbin/crond` while scripts in '/etc/cron.daily', '/etc/cron.weekly', and '/etc/cron.monthly' are run by indirectly by `/usr/sbin/crond` through `/usr/sbin/anacron`.

[karol@black ~]$ cat /etc/anacrontab 
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22

#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

As you can see, anacron does run daily, weekly and monthly jobs, but not hourly.


Can you post some of the e-mails you want to get rid of? Maybe they are error-related - do you have /etc/cron.hourly/ directory at all?

Offline

#4 2011-10-16 15:36:21

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,716
Website

Re: a better may to disable cronie sending mail

@karol - I have nothing in my /etc/cron.hourly/

The offending script was in root's crontab.  I have since appended the following to it which fixed the mails:  > /dev/null 2>&1


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB