Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to make cron to send emails

I have cron working on a single-user Fedora22, and am trying to make the cron to send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

It runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

It runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default wolfvredact@yahoo.com

How to make cron to send emails?

How to make cron to send emailsemails?

I have cron working on a single-user Fedora22, and am trying to make the cron to send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

It runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

It runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default wolfvredact@yahoo.com

How to make cron to send emails?

How to make cron to send emails?

I have cron working on a single-user Fedora22, and am trying to make the cron to send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

It runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

It runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default wolfvredact@yahoo.com

How to make cron to send emails?

How to make cron send emails?

I have cron working on a single-user Fedora22, and am trying to make the cron to send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

It cron runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

It cron runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default wolfvredact@yahoo.com

How to make cron to send emails?

How to make cron send emails?

I have cron working on a single-user Fedora22, and am trying to make the cron to send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default wolfvredact@yahoo.com
redact@yahoo.com

How to make cron to send emails?

How to make cron send emails?

I have cron working on a single-user Fedora22, and am trying to make the cron to send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default redact@yahoo.com

How to make cron to send emails?

UPDATE: I got cron to send emails another way. Now I am trying to get cronic to work. Here are the results:


Explicit cronic path and msmtp for specific cron jobs

13:50 crontab, no email, backup worked:

\*/10 * * * * /usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 13:50:01 localhost.localdomain CROND[15058]: (wolfv) CMD (/usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Nothing in journalctl -u:

$ journalctl -u crond --since 13:50

Entry in .msmtp.log:

Jul 29 13:50:37 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com errormsg='the server sent an empty reply' exitcode=EX_PROTOCOL

msmtp for specific cron jobs

14:00 crontab, email sent, backup worked:

\*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 14:00:01 localhost.localdomain CROND[16166]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Entry in journalctl -u:

$ journalctl -u crond --since 14:00
-- Logs begin at Sat 2011-12-31 17:00:18 MST, end at Wed 2015-07-29 14:40:40 MDT. --
Jul 29 14:01:01 localhost.localdomain CROND[17142]: (root) CMD (run-parts /etc/cron.hourly)

Entry in .msmtp.log:

Jul 29 14:00:44 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com mailsize=2032 smtpstatus=250 smtpmsg='250 OK , completed' exitcode=EX_OK

With MAILTO

14:40 crontab, no email, backup worked:

MAILTO=redact@yahoo.com

\*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local

Interestingly, this is the only journal entry that detected the error I planted in backup_script: line 17. Entry in journalctl:

$ journalctl --since 14:40
Jul 29 14:40:01 localhost.localdomain CROND[20390]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (/home/wolfv/backup_script: line 17: error: command not found)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Building synchronization state...)
Jul 29 14:40:04 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At destination listing 10000...)
Jul 29 14:40:05 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At source listing 10000...)
Jul 29 14:40:09 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Starting synchronization)

Nothing in journalctl -u:

$ journalctl -u crond --since 14:40

Nothing in .msmtp.log


I would still like to get MAILTO working. But more importantly, I would like to get cronic to send emails.

I was going by the cronic documentation on http://hackersome.com/p/benjaminoakes/cronic and http://habilis.net/cronic/

How to make cron send emails?

I have cron working on a single-user Fedora22, and am trying to make the cron to send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default redact@yahoo.com

How to make cron to send emails?

UPDATE: I got cron to send emails another way. Now I am trying to get cronic to work. Here are the results:


Explicit cronic path and msmtp for specific cron jobs

13:50 crontab, no email, backup worked:

\*/10 * * * * /usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 13:50:01 localhost.localdomain CROND[15058]: (wolfv) CMD (/usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Nothing in journalctl -u:

$ journalctl -u crond --since 13:50

Entry in .msmtp.log:

Jul 29 13:50:37 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com errormsg='the server sent an empty reply' exitcode=EX_PROTOCOL

msmtp for specific cron jobs

14:00 crontab, email sent, backup worked:

\*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 14:00:01 localhost.localdomain CROND[16166]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Entry in journalctl -u:

$ journalctl -u crond --since 14:00
-- Logs begin at Sat 2011-12-31 17:00:18 MST, end at Wed 2015-07-29 14:40:40 MDT. --
Jul 29 14:01:01 localhost.localdomain CROND[17142]: (root) CMD (run-parts /etc/cron.hourly)

Entry in .msmtp.log:

Jul 29 14:00:44 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com mailsize=2032 smtpstatus=250 smtpmsg='250 OK , completed' exitcode=EX_OK

With MAILTO

14:40 crontab, no email, backup worked:

MAILTO=redact@yahoo.com

\*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local

Interestingly, this is the only journal journalctl entry that detected the error I planted in backup_script: line 17. Entry in journalctl:17:

$ journalctl --since 14:40
Jul 29 14:40:01 localhost.localdomain CROND[20390]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (/home/wolfv/backup_script: line 17: error: command not found)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Building synchronization state...)
Jul 29 14:40:04 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At destination listing 10000...)
Jul 29 14:40:05 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At source listing 10000...)
Jul 29 14:40:09 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Starting synchronization)

Nothing in journalctl -u:

$ journalctl -u crond --since 14:40

Nothing in .msmtp.log


I would still like to get MAILTO working. But more importantly, I would like to get cronic to send emails.

I was going by the cronic documentation on http://hackersome.com/p/benjaminoakes/cronic and http://habilis.net/cronic/

How to make cron send emails?

I have cron working on a single-user Fedora22, and am trying to make the cron to send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default redact@yahoo.com

How to make cron to send emails?

UPDATE: I got cron to send emails another way. Now I am trying to get cronic to work. Here are the results:


Explicit cronic path and msmtp for specific cron jobs

13:50 crontab, no email, backup worked:

\*/10 * * * * /usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 13:50:01 localhost.localdomain CROND[15058]: (wolfv) CMD (/usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Nothing in journalctl -u:

$ journalctl -u crond --since 13:50

Entry in .msmtp.log:

Jul 29 13:50:37 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com errormsg='the server sent an empty reply' exitcode=EX_PROTOCOL

msmtp for specific cron jobs

14:00 crontab, email sent, backup worked:

\*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 14:00:01 localhost.localdomain CROND[16166]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Entry in journalctl -u:

$ journalctl -u crond --since 14:00
-- Logs begin at Sat 2011-12-31 17:00:18 MST, end at Wed 2015-07-29 14:40:40 MDT. --
Jul 29 14:01:01 localhost.localdomain CROND[17142]: (root) CMD (run-parts /etc/cron.hourly)

Entry in .msmtp.log:

Jul 29 14:00:44 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com mailsize=2032 smtpstatus=250 smtpmsg='250 OK , completed' exitcode=EX_OK

With MAILTO

14:40 crontab, no email, backup worked:

MAILTO=redact@yahoo.com

\*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local

Interestingly, this is the only journalctl entry that detected the error I planted in backup_script: line 17:

$ journalctl --since 14:40
Jul 29 14:40:01 localhost.localdomain CROND[20390]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (/home/wolfv/backup_script: line 17: error: command not found)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Building synchronization state...)
Jul 29 14:40:04 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At destination listing 10000...)
Jul 29 14:40:05 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At source listing 10000...)
Jul 29 14:40:09 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Starting synchronization)

Nothing in journalctl -u:

$ journalctl -u crond --since 14:40

Nothing in .msmtp.log


I would still like to get MAILTO working. But more importantly, I would like to get cronic to send emails.

I was going by the cronic documentation on http://hackersome.com/p/benjaminoakes/cronic and http://habilis.net/cronic/

How to make cron send emails?

I have cron working on a single-user Fedora22, and am trying to make the cron send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default redact@yahoo.com

How to make cron to send emails?

UPDATE: I got cron to send emails another way. Now I am trying to get cronic to work. Here are the results:


Explicit cronic path and msmtp for specific cron jobs

13:50 crontab, crontab with cronic, no email, backup worked:

\*/10 * * * * /usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 13:50:01 localhost.localdomain CROND[15058]: (wolfv) CMD (/usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Nothing in journalctl -u:

$ journalctl -u crond --since 13:50

Entry in .msmtp.log:

Jul 29 13:50:37 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com errormsg='the server sent an empty reply' exitcode=EX_PROTOCOL

msmtp for specific cron jobs

14:00 crontab, email sent, backup worked:

\*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 14:00:01 localhost.localdomain CROND[16166]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Entry in journalctl -u:

$ journalctl -u crond --since 14:00
-- Logs begin at Sat 2011-12-31 17:00:18 MST, end at Wed 2015-07-29 14:40:40 MDT. --
Jul 29 14:01:01 localhost.localdomain CROND[17142]: (root) CMD (run-parts /etc/cron.hourly)

Entry in .msmtp.log:

Jul 29 14:00:44 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com mailsize=2032 smtpstatus=250 smtpmsg='250 OK , completed' exitcode=EX_OK

With MAILTO

14:40 crontab, no email, backup worked:

MAILTO=redact@yahoo.com

\*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local

Interestingly, this is the only journalctl entry that detected the error I planted in backup_script: line 17:

$ journalctl --since 14:40
Jul 29 14:40:01 localhost.localdomain CROND[20390]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (/home/wolfv/backup_script: line 17: error: command not found)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Building synchronization state...)
Jul 29 14:40:04 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At destination listing 10000...)
Jul 29 14:40:05 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At source listing 10000...)
Jul 29 14:40:09 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Starting synchronization)

Nothing in journalctl -u:

$ journalctl -u crond --since 14:40

Nothing in .msmtp.log


I would still like to get MAILTO working. But more importantly, I would like to get cronic to send emails.

I was going by the cronic documentation on http://hackersome.com/p/benjaminoakes/cronic and http://habilis.net/cronic/

How to make cron send emails?

I have cron working on a single-user Fedora22, and am trying to make the cron send emails. This is my crontab:

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails.

So I add a MAILTO line as described in https://wiki.archlinux.org/index.php/Msmtp#Cronie_default_email_client

MAILTO=redact@yahoo.com

*/10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local
44 00,12 * * * /home/wolfv/backup_script /home/wolfv gs://wolfv

cron runs the script as scheduled but does not send emails, and does not leave an entry in the .msmtp.log.

My msmtp is working. This sends email and leaves an entry in the .msmtp.log:

$ cat test.mail | msmtp -a default redact@yahoo.com

How to make cron to send emails?

UPDATE: I got cron to send emails another way. Now I am trying to get cronic to work. Here are the results:


Explicit cronic path and msmtp for specific cron jobs

13:50 crontab with cronic, no email, backup worked:

\*/10 */10 * * * * /usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 13:50:01 localhost.localdomain CROND[15058]: (wolfv) CMD (/usr/local/bin/cronic /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Nothing in journalctl -u:

$ journalctl -u crond --since 13:50

Entry in .msmtp.log:

Jul 29 13:50:37 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com errormsg='the server sent an empty reply' exitcode=EX_PROTOCOL

msmtp for specific cron jobs

14:00 crontab, email sent, backup worked:

\*/10 */10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com

Entry in journalctl:

Jul 29 14:00:01 localhost.localdomain CROND[16166]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local  2>&1 | msmtp redact@yahoo.com)

Entry in journalctl -u:

$ journalctl -u crond --since 14:00
-- Logs begin at Sat 2011-12-31 17:00:18 MST, end at Wed 2015-07-29 14:40:40 MDT. --
Jul 29 14:01:01 localhost.localdomain CROND[17142]: (root) CMD (run-parts /etc/cron.hourly)

Entry in .msmtp.log:

Jul 29 14:00:44 host=smtp.mail.yahoo.com tls=on auth=on user=redact@yahoo.com from=redact@yahoo.com recipients=redact@yahoo.com mailsize=2032 smtpstatus=250 smtpmsg='250 OK , completed' exitcode=EX_OK

With MAILTO

14:40 crontab, no email, backup worked:

MAILTO=redact@yahoo.com

\*/10 */10 * * * * /home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local

Interestingly, this is the only journalctl entry that detected the error I planted in backup_script: line 17:

$ journalctl --since 14:40
Jul 29 14:40:01 localhost.localdomain CROND[20390]: (wolfv) CMD (/home/wolfv/backup_script /home/wolfv /home/wolfv/backup_local)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (/home/wolfv/backup_script: line 17: error: command not found)
Jul 29 14:40:01 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Building synchronization state...)
Jul 29 14:40:04 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At destination listing 10000...)
Jul 29 14:40:05 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (At source listing 10000...)
Jul 29 14:40:09 localhost.localdomain CROND[20387]: (wolfv) CMDOUT (Starting synchronization)

Nothing in journalctl -u:

$ journalctl -u crond --since 14:40

Nothing in .msmtp.log


I would still like to get MAILTO working. But more importantly, I would like to get cronic to send emails.

I was going by the cronic documentation on http://hackersome.com/p/benjaminoakes/cronic and http://habilis.net/cronic/