sfritz / fail_mail

Wraps your scripts and emails you when they fail. Useful for cron.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update: Turns out I'm not the first person to be frustrated by cron emails. Try chronic from moreutils, or cronic, or shush, or cronwrap.

fail_mail

Wraps your scripts and emails you when they fail. Useful for cron.

example

Your cron used to be this:

MAILTO=sfritz@example.com
0 2 * * 1-5 ruby example.rb

Change to this:

0 2 * * 1-5 ./fail_mail 'ruby example.rb' --from cron --to sfritz@example.com --subject 'Example Job Failed!'

Now you only get bothered when the job has a non-zero exit status. Sends stdout and stderr in the body.

FROM: cron@jobbox
TO: sfritz@example.com
SUBJECT: Example Job Failed!

Everything was going fine until...
...Something went wrong!

About

Wraps your scripts and emails you when they fail. Useful for cron.

License:MIT License


Languages

Language:Ruby 100.0%