Mailinglist Archive: opensuse (1815 mails)

< Previous Next >
Re: [opensuse] mail from cron ?
  • From: "Carlos E. R." <robin.listas@xxxxxxxxxxxxxx>
  • Date: Mon, 05 Jul 2010 18:16:32 +0200
  • Message-id: <4C320560.8000002@xxxxxxxxxxxxxx>
Hash: SHA1

On 2010-07-05 17:56, Chuck Payne wrote:
On Mon, Jul 5, 2010 at 11:42 AM, Dave Howorth <> wrote:

I have an 11.2 system and am having trouble configuring it to send me
mail from some cron jobs. The problem is the /root/bin/cron.daily.local
script. I know it runs because I have a line in it that says

date >> /root/cron.dbg

Instead, in "/etc/sysconfig/cron" set this:


This will write an entry in the syslog (/var/log/message file) when the jobs

Jul 4 20:15:01 Elessar run-crons[26711]: mcelog: OK
Jul 4 21:15:01 Elessar run-crons[27800]: mcelog: OK
Jul 4 22:00:24 Elessar run-crons[30397]: beagle-crawl-system: OK
Jul 4 22:00:24 Elessar run-crons[30397]: logrotate: OK
Jul 4 22:00:24 Elessar run-crons[30397]: suse-clean_catman: OK
Jul 4 22:01:52 Elessar run-crons[30397]: suse-do_mandb: OK
Jul 4 22:02:02 Elessar run-crons[30397]: suse-texlive: OK

and the file gets a new line added every day. The script also has a
mailto line and a line that prints output:

echo 'This is /root/bin/cron.daily.local'

Try that first with a local user in that machine, like "root" or "dhoworth". In
order to be able to
sent outside, your "from" domain has got to be real, or the destination will
reject it as a spammer.
And the "from" will be set to something like "cron@xxxxxxxxxxxxxxxxxxxxxxxxxx".

Check the mail log in any case to be sure.

The sysconfig variable SEND_MAIL_ON_NO_ERROR is set to yes but I get no
mail from the job. I do get mail from a job in root's crontab:


Ah, you do...

Then, check the logs. First do the change I suggested above, then look at the
mail log and the
system logs.

What am I missing? :(

What agent are you using to send the mail. I use mail and mailx, some
people use mutt.

You don't need an agent, or not one you can choose: it is choosen by the suse
people that wrote the
cron system jobs. Ie: "mail":

if [ -n "${STATUS}" -o "$SEND_MAIL_ON_NO_ERROR" = "yes" ] ; then
mail ${SEND_TO} -s "${TITLE}" < ${CONTROL_MAIL}

- --
Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 "Emerald" GM (Elessar))
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with SUSE -

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups