He configurado cronjob para el usuario root. Sin embargo, cuando el cron falla, debería recibir un correo electrónico del cronjob porque configuré MAILTO como este en / etc / crontab:
MAILTO=my@email.com
He instalado mailx usando
yum install mailx
Pero cuando miro el registro cron obtengo estas líneas:
Feb 23 14:13:01 internal crond[6858]: (root) CMD (/var/www/vded/build/bin/sync.sh)
Feb 23 14:13:01 internal crond[6857]: (root) MAIL (mailed 79 bytes of output but got status 0x0001 )
¿Cómo puedo arreglar esto?
ACTUALIZACIÓN
- Instalé mailx y sendmail usando yum.
- Empecé sendmail.
- ¡Ahora enviar un correo electrónico funciona desde la línea de comandos!
Me sale este error en el registro de correo:
Feb 23 16:06:01 internal sendmail[7210]: o1NG61cd007210: from=root, size=425, class=0, nrcpts=1, msgid=<201002231606.o1NG61cd007210@internal.fff.com>, relay=root@localhost
Feb 23 16:06:01 internal sendmail[7211]: o1NG61hT007211: from=<root@internal.fff.com>, size=732, class=0, nrcpts=1, msgid=<201002231606.o1NG61cd007210@internal.fff.com>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Feb 23 16:06:01 internal sendmail[7210]: o1NG61cd007210: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30425, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o1NG61hT007211 Message accepted for delivery)
Feb 23 16:06:01 internal sendmail[7212]: o1NG61hT007211: to=<root@internal.fff.com>, ctladdr=<root@internal.fff.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30972, dsn=2.0.0, stat=Sent
internal.fff.com es el nombre del servidor.
ACTUALIZACIÓN
De hecho, si pongo el MAILTO=my@email.com
como la primera línea de mi crontab (usando crontab -e
) está funcionando.
¿Por qué no funciona ajustando el MAILTO
de /etc/crontab
?
Gracias