Cron Job Monitoring Snippet Generator

Wrap any scheduled command so it reports success or failure to a heartbeat URL. Copy the version for your shell or language.

  • Free
  • No sign-up
  • Runs in your browser
SensaCat monitors need the URL token and your account’s API key. Leave empty for services that only use the URL.

Bash wrapper


    

How to use the Heartbeat Ping Snippet Generator

  1. Paste your heartbeat URL and, for SensaCat, your API key.
  2. Enter the command your cron job runs and its schedule.
  3. Choose a language, and whether failures should be reported with the exit code.
  4. Replace the job in your crontab or scheduler with the generated snippet.

Know when a cron job doesn’t run

SensaCat gives every scheduled job a heartbeat URL and alerts your team by email, Slack or Discord when a ping is late or reports a failure.

Start monitoring free

Frequently asked questions

-f makes curl exit with an error on HTTP failures, -s hides the progress bar so cron doesn’t email it to you, and -S still prints real errors. Add -m to cap how long the ping can take so it never hangs the job.

Usually not. The generated wrappers exit with your command’s exit code, not the ping’s, so a monitoring problem never changes how the job behaves.

The snippet sends a JSON body with status set to failure and the exit code as the message. A ping with an empty body counts as success.

Yes. Use the PowerShell version, which reads $LASTEXITCODE after your script runs and calls Invoke-RestMethod.

Related tools

Cron Heartbeat Calculator

Get the expected interval and grace period to monitor a cron job without false alarms.

Runs in your browser Open tool

Crontab Validator

Check a whole crontab for syntax errors and the mistakes that make jobs fail silently.

Runs in your browser Open tool

Webhook Tester

Get a temporary URL and inspect the headers and body of every webhook sent to it.

Uses our server Open tool