CronHealth documentation

Add a success ping to your scheduled jobs.

These examples show how to call your CronHealth ping URL after cron jobs, backups, syncs, reports, commands, and scheduled tasks complete successfully.

Quick start

Create a monitor in CronHealth, copy the generated ping URL, and call it after your job finishes successfully.

1

Create monitor

Name the job and choose interval or cron expression.

2

Add ping URL

Place the URL at the end of your job.

3

Get alerts

Choose email, Slack, Discord, or webhook destinations for missed and recovered alerts.

basic pattern
# Run your real task first.
# Ping CronHealth only if it succeeds.

your-command-here \
  && curl -fsS -m 10 --retry 3 \
  https://cronhealth.io/ping/your-monitor-token

Important rules

Ping after success

The ping should mean “the job completed successfully,” not just “the job started.”

Use timeout and retry

Use curl timeout/retry options so a temporary network issue does not block your script for too long.

Add a grace period

If your job runs daily at 03:00 but sometimes finishes at 03:15, use a grace period like 30 minutes.

Use one monitor per important job

Separate monitors make it easier to see exactly which automation stopped checking in.

Linux cron

Add the ping URL after your command using &&. This ensures CronHealth is pinged only if the command exits successfully.

crontab
# Run database backup every day at 03:00
# Cron expression: 0 3 * * *

0 3 * * * /app/bin/backup.sh \
  && curl -fsS -m 10 --retry 3 \
  https://cronhealth.io/ping/your-monitor-token

Bash script

For more control, put the ping inside the script after all important steps complete.

backup.sh
#!/bin/bash
set -e

# Run important work
/usr/bin/pg_dump -U postgres app_db > /backups/app_db.sql

# Upload backup or run additional checks
/usr/bin/rclone copy /backups remote:backups

# Ping CronHealth only after everything succeeds
curl -fsS -m 10 --retry 3 \
  https://cronhealth.io/ping/your-monitor-token

Symfony command

If you run scheduled Symfony commands, ping CronHealth after the command succeeds.

crontab
# Run Symfony command every hour
# Cron expression: 0 * * * *

0 * * * * cd /var/www/app \
  && php bin/console app:sync-subscriptions \
  && curl -fsS -m 10 --retry 3 \
  https://cronhealth.io/ping/your-monitor-token

Tip: keep the ping outside the command for MVP simplicity. Later, you can call the ping from inside PHP if needed.

Laravel scheduler

Laravel has scheduler hooks that can ping CronHealth after a scheduled command succeeds.

app/Console/Kernel.php
// Run reports daily and ping after success

$schedule->command('reports:generate')
    ->dailyAt('03:00')
    ->thenPing('https://cronhealth.io/ping/your-monitor-token');

Node.js

Ping CronHealth from a Node.js script after your async work finishes successfully.

sync.js
async function main() {
  // Run your important scheduled work
  await syncSubscriptions();

  // Ping CronHealth after success
  await fetch('https://cronhealth.io/ping/your-monitor-token', {
    method: 'POST'
  });
}

main().catch((error) => {
  console.error(error);
  process.exit(1);
});

Python

Ping CronHealth after your Python task completes without exceptions.

sync.py
import requests

def main():
    # Run your important scheduled work
    run_data_import()

    # Ping CronHealth after success
    requests.post(
        "https://cronhealth.io/ping/your-monitor-token",
        timeout=10,
    )

if __name__ == "__main__":
    main()

Docker container cron

If your scheduled task runs inside a container, install curl or use the language runtime to call the ping URL.

container crontab
# Run cleanup every 6 hours
# Cron expression: 0 */6 * * *

0 */6 * * * /usr/local/bin/cleanup.sh \
  && curl -fsS -m 10 --retry 3 \
  https://cronhealth.io/ping/your-monitor-token

GitHub Actions scheduled workflow

You can also monitor scheduled GitHub Actions workflows. Ping CronHealth in the final step after successful work.

.github/workflows/daily-report.yml
name: Daily report

on:
  schedule:
    - cron: '0 3 * * *'

jobs:
  report:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Generate report
        run: ./scripts/generate-report.sh

      - name: Ping CronHealth
        run: |
          curl -fsS -m 10 --retry 3 \
            https://cronhealth.io/ping/your-monitor-token

Alert channels

A monitor can notify multiple destinations. Add alert channels in the dashboard, then select one or more of them when you create or edit a monitor. CronHealth sends a missed-ping alert when the monitor becomes late, and a recovery alert when a successful ping arrives again.

Email recipients

Add each email recipient as its own alert channel from Alert channels. You can keep the default account email destination and add extra recipients such as teammates, shared inboxes, or on-call aliases.

  1. Open Alert channels in the dashboard.
  2. Click Add Email.
  3. Enter a label and the recipient email address.
  4. Select that email destination on each monitor that should notify it.

Slack

Click Connect Slack. CronHealth redirects you to Slack, where you choose the workspace and channel, then grant access. After Slack returns you to CronHealth, the selected channel appears as a Slack alert channel. Repeat the flow for each additional Slack channel.

  1. Click Connect Slack from CronHealth.
  2. Choose the Slack workspace.
  3. Pick the channel that should receive alerts.
  4. Approve the incoming webhook permission.
  5. Back in CronHealth, select the new Slack channel on your monitors.

Discord

In Discord, open the target server channel settings, create an integration webhook, copy its webhook URL, then paste that URL into CronHealth with a clear channel name.

  1. In Discord, open the server channel settings.
  2. Go to Integrations, then Webhooks.
  3. Create a webhook for the channel and copy its webhook URL.
  4. In CronHealth, click Add Discord Webhook and paste the URL.
  5. Select the Discord destination on the monitors that should use it.

Custom webhook

Add a HTTPS endpoint that accepts JSON POST requests. Use this for internal incident tools, automation platforms, or custom notification routers.

  1. Create an HTTPS endpoint in your app or automation tool.
  2. Make sure it accepts POST requests with a JSON body.
  3. Click Add Custom Webhook in CronHealth and paste the endpoint URL.
  4. Use Test to confirm delivery before assigning it to critical monitors.

Selecting channels on a monitor

  1. 1. Create channelsAdd all email, Slack, Discord, and webhook destinations you need.
  2. 2. Edit monitorOpen the monitor form and select the enabled destinations that should receive its alerts.
  3. 3. Test deliveryUse the alert-channel test action to confirm the destination receives CronHealth messages.
custom webhook POST payloads
# Missed ping alert
POST https://your-app.example.com/cronhealth
Content-Type: application/json

{
  "event": "monitor.late",
  "monitor_name": "Nightly backup",
  "status": "late",
  "expected_at": "2026-06-18T03:10:00+00:00",
  "checked_at": "2026-06-18T03:11:00+00:00",
  "dashboard_url": "https://cronhealth.io/app/monitors/..."
}

# Recovery alert
{
  "event": "monitor.recovered",
  "monitor_name": "Nightly backup",
  "status": "recovered",
  "expected_at": "2026-06-18T03:10:00+00:00",
  "checked_at": "2026-06-18T03:20:00+00:00",
  "dashboard_url": "https://cronhealth.io/app/monitors/..."
}

Monitor statuses

Pending

Created but no ping received yet.

Healthy

Latest ping arrived on time.

Late

Expected ping missed grace period.

Paused

Temporarily disabled.

FAQ

Should I ping CronHealth if the job fails?

For the MVP, no. The recommended pattern is to ping only after success. If the job fails and does not ping, CronHealth will mark the monitor late.

Can I use GET or POST?

Yes. CronHealth accepts both GET and POST pings for simple setup.

What if my job runs more often than every 5 minutes?

During early access, the minimum interval is 5 minutes to keep the free MVP stable and simple.

Will I receive repeated alerts every minute?

No. CronHealth sends one missed-ping alert when a monitor becomes late and one recovery alert when it receives a successful ping again.

Ready to monitor your first job?

Create a free monitor, copy the ping URL, and add it to one important automation.

Start free