Cron Job Monitoring for Railway

Railway's cron jobs run your services on a schedule. Railway doesn't alert you when they fail or stop running. DeadManCheck does — in two minutes of setup.

How cron jobs work on Railway

Railway cron jobs start a service on a cron schedule, run it to completion, then stop it. The minimum interval is 5 minutes. There's no built-in alerting when a job fails or stops running — Railway logs the run, but it won't page you.

That means a Railway cron job that crashes, hangs, or silently processes nothing will go unnoticed until you happen to check the logs.

What can go wrong on Railway

Integrating DeadManCheck with Railway

Create a monitor at deadmancheck.io, set the interval to match your Railway cron schedule, and add the ping to your service.

For a Python service

import requests, os

TOKEN = os.environ["DEADMANCHECK_TOKEN"]
BASE = f"https://deadmancheck.io/ping/{TOKEN}"

def main():
    requests.get(f"{BASE}/start", timeout=5)
    try:
        count = run_job()
        requests.get(BASE, params={"count": count}, timeout=5)
    except Exception:
        requests.get(f"{BASE}/fail", timeout=5)
        raise

if __name__ == "__main__":
    main()

For a bash/shell service

#!/bin/bash
set -euo pipefail

BASE="https://deadmancheck.io/ping/${DEADMANCHECK_TOKEN}"

curl -fsS "${BASE}/start" > /dev/null
trap 'curl -fsS "${BASE}/fail" > /dev/null' ERR

/app/run-export.sh

curl -fsS "${BASE}" > /dev/null

Setting the environment variable on Railway

Add DEADMANCHECK_TOKEN to your Railway service's environment variables: Railway dashboard → your service → Variables → Add variable.

Output assertions for Railway jobs

Railway's cron only knows whether your service exited 0 or non-zero. It has no concept of "this job ran but processed nothing."

Include a count in your DeadManCheck ping and configure an assertion: "alert if count is 0". Now your Railway backup job that silently exports nothing triggers an alert — even though Railway marks it as successful. Learn more about output assertions →

Related guides

Start monitoring free — no credit card needed

Free for 5 monitors. $12/mo for 100.