Linux · cron

Cron job monitoring for missed, failed and stuck jobs

Add start and finish signals to cron. Tickwatch detects missed runs, failures and runtime overruns, then sends an alert.

Free: 5 monitors, Telegram and email.

Example alert

● nightly-import

The job reported a failed run.

Open monitor

Demo data. Message appearance and fields depend on the channel and event type.

When you need this

Your website can stay online while a nightly import, report or queue cleanup has stopped running. An HTTP check cannot confirm a background job finished. Tickwatch expects a signal on the job schedule and tracks its start, completion and failure separately.

How to connect

  1. 1

    Create a cron monitor with the scheduler’s expression and timezone, plus an allowance for late runs.

  2. 2

    Save the wrapper below and replace the job invocation in crontab with the wrapped command.

  3. 3

    Connect Telegram or email. Verify one successful run, one failure and one missed run using a test job.

Ready-to-use example

Install Bash, curl and uuidgen on the job server. Save the code as /opt/tickwatch-run.sh, replace the ping URL with your own and use the absolute path to your job. Keep the ping key private. The wrapper preserves the job exit code; a failed monitoring request does not interrupt it.

tickwatch-run.sh
#!/usr/bin/env bash
# Save as tickwatch-run.sh; run: bash tickwatch-run.sh /path/to/job.sh
if [ "$#" -eq 0 ]; then echo "Usage: $0 command [args...]" >&2; exit 2; fi
PING='https://ping.tickwatch.dev/YOUR_PING_KEY'
RID=$(uuidgen) || exit 1
ping() {
  curl -fsS --connect-timeout 3 --max-time 5 --retry 2 --retry-max-time 12 \
    -X POST "$PING/$1?rid=$RID" >/dev/null 2>&1 || true
}
finish() {
  code=$?
  trap - EXIT
  if [ "$code" -eq 0 ]; then ping ""; else ping fail; fi
  exit "$code"
}
trap finish EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
ping start
"$@"
Run or configure
0 3 * * * /usr/bin/bash /opt/tickwatch-run.sh /usr/local/bin/job.sh

Check before going live

  • A nonzero exit code sends /fail. Missing signals are detected after the deadline and grace period.

  • Set a maximum runtime to catch a /start signal with no matching completion.

  • Check PATH, permissions, working directory and environment for the cron user. Running a command in your terminal does not reproduce that environment.

Common questions

Do I need a server agent?

This setup only needs outgoing HTTPS requests from curl. No inbound port needs to be opened for Tickwatch.

What if the whole server goes offline?

Signals stop arriving and the monitor detects a missed deadline. This identifies a missing report, not the root cause of the server outage.

Verify your first run while the job still works

Create a monitor, insert your ping URL and check that signals and notifications arrive.

Cron job monitoring for missed, failed and stuck jobs · Tickwatch