-----BEGIN PGP SIGNED MESSAGE----- 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: SYSLOG_ON_NO_ERROR="yes" This will write an entry in the syslog (/var/log/message file) when the jobs run: 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:
MAILTO=dhoworth@my.domain.uk 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@yourmachinename.yourdomain". 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:
SHELL=/bin/bash MAILTO=dhoworth@my.domain.uk
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} fi - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Elessar)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkwyBWAACgkQU92UU+smfQWk6ACghrePT40GvTVcX6MORN/JX8rW rwcAmwWdf54R1jcU9WgddFHZQDgse6zw =FnN4 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org