How to get cron tasks output via email

  1. Enter your email address, where cron tasks output would be sent:
  2. There are 2 main options how to get cron tasks output via email. Choose one of them.

    1. This option would work only if your server has been configured to send emails. You can check that, for example, by running: echo 'test' | mail -s "test" your@emailaddress.com If you get an email after that then it works. If not then just proceed to option B.

      Open crontab on your server: crontab -e

      Add MAILTO=sg4go4k04oc40g4o800wwosgw4sc8gss@ai.notifier.in variable at the beginning of the config. So it should look the following way: MAILTO=sg4go4k04oc40g4o800wwosgw4sc8gss@ai.notifier.in

      # Your cron tasks...

      to check the integration.
    2. This option requires cURL to be installed on your server. Check it by running: curl --version You should see something like that: curl 7.47.0 ... If that's not the case then you should install it first.

      Open crontab on your server: crontab -e

      If you'd like to be notified about all output (STDIN and STDERR) add the following code after each of your tasks: | curl -H "Content-Type: text/plain" --data-binary @- https://notifier.in/webhook/sg4go4k04oc40g4o800wwosgw4sc8gss So it should look the following way: 2 3 * * * ./your_example_script.sh | curl -H "Content-Type: text/plain" --data-binary @- https://notifier.in/webhook/sg4go4k04oc40g4o800wwosgw4sc8gss
      9 * * * * ./your_another_example_script.sh | curl -H "Content-Type: text/plain" --data-binary @- https://notifier.in/webhook/sg4go4k04oc40g4o800wwosgw4sc8gss

      If you'd like to be notified only about error output (STDERR) add the following code after each of your tasks: 2>&1>/dev/null | curl -H "Content-Type: text/plain" --data-binary @- "https://notifier.in/webhook/sg4go4k04oc40g4o800wwosgw4sc8gss?ignoreEmptyBody=1" So it should look the following way: 2 3 * * * ./your_example_script.sh 2>&1>/dev/null | curl -H "Content-Type: text/plain" --data-binary @- "https://notifier.in/webhook/sg4go4k04oc40g4o800wwosgw4sc8gss?ignoreEmptyBody=1"
      9 * * * * ./your_another_example_script.sh 2>&1>/dev/null | curl -H "Content-Type: text/plain" --data-binary @- "https://notifier.in/webhook/sg4go4k04oc40g4o800wwosgw4sc8gss?ignoreEmptyBody=1"

      to check the integration.
In the free version you could receive up to 100 notifications per month. Create a paid account to receive up to 1,000 email notifications.

Check other related integrations:

Miss some integration? Drop me a line with the request.