Task Setup Guide

Where does your task run?

To monitor your your task with Bringschuld you need to send an HTTP request to your task's unique URL when it finishes successfully. This works in any environment capable of making HTTP requests.

For your convenience, we have put together some code snippets to make your live easier. If your language of choice is not in the tabs above don't worry. Simply find out how to make an HTTP request to your task's URL:

https://www.bringschuld.io/check_in/yourTaskToken
A cronjob in your crontab might be scheduled something like this:
0 1 * * * ./mybackup.sh
Change this line to
0 1 * * * ./mybackup.sh && curl https://www.bringschuld.io/check_in/yourTaskToken --retry 10 --retry-connrefused &> /dev/null
to send a check-in every time your task completes successfully.

Note that this snippet interprets "successfully" as "./mybackup.sh exits with exit code 0". Make sure that ./mybackup.sh only exits with exit code 0 if it completed successfully.

For more advanced usage of curl refer to the "Command Line" tab above.

To simply check in without doing anything fancy use:

curl https://www.bringschuld.io/check_in/yourTaskToken

To pass a message with your check in use the following:

curl -d 'm=detailed information' https://www.bringschuld.io/check_in/yourTaskToken

To send a message containing the run time of your task, you can use:

m=`time ( your_command &> /dev/null) 2>&1` && curl -d "m=$m" https://www.bringschuld.io/check_in/yourTaskToken

This is useful if your task doesn't always start at the beginning of its Bringschuld interval.

To ignore the output from curling the URL you can tack on &> /dev/null at the end of any of the commands above.

curl https://www.bringschuld.io/check_in/yourTaskToken &> /dev/null

The option --retry 10 lets curl retry a failing request up to ten times:

curl https://www.bringschuld.io/check_in/yourTaskToken --retry 10 --retry-connrefused &> /dev/null

It is preferable to use HTTP instead of email check-ins wherever possible, as HTTP requests are easier to set up and quicker than email.

However, if you want to test that emails sent by your periodic tasks are finding their recipients you should use email check-ins. Tweak your email logic so it also sends an email to:

yourTaskToken@checkin.bringschuld.io

This way you will not only be alerted if the task fails to run, but also if there is something like an email queuing problem.

The Email's subject will be visible in the Bringschuld dashboard.

require 'net/http'
begin
  Net::HTTP.get(URI.parse('https://www.bringschuld.io/check_in/yourTaskToken'))
rescue Exception => e
end
from urllib2 import urlopen
try:
  urlopen('https://www.bringschuld.io/check_in/yourTaskToken')
except Exception:
  pass

Using file_get_contents:

file_get_contents('https://www.bringschuld.io/check_in/yourTaskToken');

Using curl

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://www.bringschuld.io/check_in/yourTaskToken',
  CURLOPT_TIMEOUT => 10,
));
curl_exec($curl);

Questions left unanswered?

Refer to our FAQ