example on how to send notification email if cron fails
See original GitHub issueas we don’t have notifications based on cronjobs yet (will be implemented in https://github.com/amazeeio/lagoon/issues/618) we could create a simple bash wrapper around commands like drush cron
which would check the return code of the command and send an email to the owner of the site.
All of this should be built in pure bash and not with any changes in lagoon.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Get email when a cron job fails (Example)
Get email when a cron job fails · Redirect all of your standard output to /dev/null or to some file. · Use the...
Read more >example on how to send notification email if cron fails #1653
Send email for failing cron · TO_ADDR to change the recipients · FROM_ADDR to change the sender · SUBJECT to change the subject...
Read more >How to get e-mail from (failed) cron-jobs in Ubuntu?
By default, cron will email the owner of the account under which the crontab is running. The system-wide crontab is in /etc/crontab runs ......
Read more >How to Send Email From Cron Jobs
You put a MAILTO=you@example.org line in your crontab, and, when a job fails, cron will send a notification to the specified address using ......
Read more >Alerting on a failed cron job
Can you post your crontab entry? By default an email would be generated if cronjob returns a non-zero result. And what do you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could we use the notification system used for the project? If we have Slack or Rocketchat notifications for the project, it’d be great that these notifications would go there by default too, with kind of zero set up or just an env variable to enable these notifications.
thx, this is working great! @shreddedbacon
I’ve slightly improved the script: