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

Receive email when expected pings stop arriving.

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

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 emails every minute?

No. CronHealth sends one email when a monitor becomes late and one recovery email 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