Dead Man's Snitch

Sign In

  1. Docs
  2. Monitoring

Cron Job Monitoring

Have you ever discovered that a critical process like backups or invoicing wasn't running when it should be? Dead Man's Snitch makes it quick and easy to have confidence that your cron jobs and other scheduled tasks are running how and when you need them to.

The fastest way to get started is to use a command line HTTP client like curl to notify Dead Man's Snitch when your cron job runs. We recommend using Field Agent, our custom reporting agent, as it opens up new ways of debugging issues that help reduce the mean time to recovery (MTTR).

Quick Start with Curl

Let's say your crontab looks like what's below with a cron job that runs every 5 minutes.

crontab - VIM (vim)
*/5 * * * * /app/

To monitor the cron job, we'll add a snippet to the end of the crontab line that makes a request to Dead Man's Snitch to let us know if the job ran correctly or not. Make sure to replace the Snitch's URL with the url of the Snitch you plan to monitor.

crontab - VIM (vim)
*/5 * * * * /app/; curl -s -d s=$?

Better Insights with Field Agent

Field Agent wraps your job, gathers extra data and metrics, and sends that data along with your check-in. This opens up new possibilities like accessing your job's error logs to get problems resolved faster. We recommend everyone use Field Agent, though some features will only be available on supporting plans.

Download and install Field Agent. Then add it to the beginning of the line in your crontab like below, using your Snitch's unique token. It's best to use the full path to the dms binary as it helps to avoid PATH issues.

crontab - VIM (vim)
*/5 * * * * /path/to/dms c2354d53d2 /app/