You are not logged in.

#1 2011-09-19 16:37:08

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Disable Hourly Cron Emails

I keep getting hourly emails from root to root on my Linux email server. This just happened with the last update and it's extremely annoying now because my mail account 'carlos' is configured to receive email for root. The emails appear very useless:

Subject: cron for user root job sys-hourly

Body = Usage: /usr/sbin/run-cron crondir

Does anyone know exactly what this means and why it's doing it? I would like to also disable these constant notifications but not interrupt any server / cron functionality.


./

Offline

#2 2011-09-19 16:51:00

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

Re: Disable Hourly Cron Emails

Offline

#3 2011-09-19 16:57:32

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Re: Disable Hourly Cron Emails

Hmmm weird. I wonder why now all of a sudden after I upgraded my Arch system they come every hour but before I never got them. Rather than deal with all of that mess above, I'm going to change the setting in /etc/aliases so my user doesn't get root's email.


./

Offline

#4 2011-09-19 16:59:55

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

Re: Disable Hourly Cron Emails

Maybe you're using another cron? Arch provides a couple.

Offline

#5 2011-09-19 17:32:28

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Re: Disable Hourly Cron Emails

I never knew that. I thought Cron was Cron and never knew Arch Linux had multiple versions of variations or Cron installed.


./

Offline

#6 2011-09-19 17:36:06

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

Re: Disable Hourly Cron Emails

Carlwill wrote:

I never knew that. I thought Cron was Cron and never knew Arch Linux had multiple versions of variations or Cron installed.

These are simply different implementations, different packages. Previously dcron was the default one, now it's cronie.

Last edited by karol (2011-09-19 17:36:29)

Offline

#7 2011-09-20 00:12:35

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

Re: Disable Hourly Cron Emails

I think you're using crond (because crond provides /usr/sbin/run-cron), not cronie, as graysky, so his fixes may not work for you.

Let's have a closer look at what /usr/sbin/run-cron is:

[karol@black ~]$ cat /usr/sbin/run-cron
#!/bin/sh
# this is a bare-bones alternative to Debian's run-parts

if ! [ -d "$1" ]; then
   echo "Usage: $0 crondir" >&2
   exit 1
fi

for cronfile in "$1"/* ; do
	if [ -x "$cronfile" ]; then
		"$cronfile"
	fi
done
unset cronfile

Body of the message you're getting is the output of /usr/sbin/run-cron run on a nonexisting directory - see the first 'if' clause in /usr/sbin/run-cron:

if ! [ -d "$1" ]; then
   echo "Usage: $0 crondir" >&2
   exit 1
fi
[karol@black ~]$ /usr/sbin/run-cron foobarbaz
Usage: /usr/sbin/run-cron crondir

Check if you have /etc/cron.hourly directory.

Offline

#8 2011-09-20 03:17:14

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Disable Hourly Cron Emails

The removal of /etc/cron.hourly/ is due to a bug[1] in pacman, which is fixed in pacman 4.0.
/etc/cron.hourly/ is part of the dcron package, so you can just reinstall dcron for now.

[1] https://bugs.archlinux.org/task/25141


This silver ladybug at line 28...

Offline

#9 2011-09-20 03:24:41

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

Re: Disable Hourly Cron Emails

lolilolicon wrote:

The removal of /etc/cron.hourly/ is due to a bug[1] in pacman, which is fixed in pacman 4.0.
/etc/cron.hourly/ is part of the dcron package, so you can just reinstall dcron for now.

[1] https://bugs.archlinux.org/task/25141

Thanks a lot! I vaguely remembered there was an issue involving cron.hourly directory https://bbs.archlinux.org/viewtopic.php?id=123484
I have some hourly cron jobs so the directory is present on my system.

Offline

Board footer

Powered by FluxBB