How to get cron tasks output via Slack

  1. Enter your Slack incoming webhook URL, where cron tasks output would be sent:

    Here you can create one if you don't have it yet.

  2. There are 2 main options how to get cron tasks output via Slack. 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=skoggkwo80o0g44ocwckcsok8wwgkggg@ai.notifier.in variable at the beginning of the config. So it should look the following way: MAILTO=skoggkwo80o0g44ocwckcsok8wwgkggg@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/skoggkwo80o0g44ocwckcsok8wwgkggg 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/skoggkwo80o0g44ocwckcsok8wwgkggg
      9 * * * * ./your_another_example_script.sh | curl -H "Content-Type: text/plain" --data-binary @- https://notifier.in/webhook/skoggkwo80o0g44ocwckcsok8wwgkggg

      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/skoggkwo80o0g44ocwckcsok8wwgkggg?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/skoggkwo80o0g44ocwckcsok8wwgkggg?ignoreEmptyBody=1"
      9 * * * * ./your_another_example_script.sh 2>&1>/dev/null | curl -H "Content-Type: text/plain" --data-binary @- "https://notifier.in/webhook/skoggkwo80o0g44ocwckcsok8wwgkggg?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 20,000 notifications.

Check other related integrations:

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