Year-end offer: 30% off your first 6 months. Order by 31 December.

Job check-ins

Know when a cron job, backup or script stops running.

A job that quietly stops is easy to miss. With a check-in, the job calls a secret address each time it runs. If the call doesn't come in time, or the job says it failed, ServerNest sends you an alert. It works for jobs on any computer, also outside ServerNest.

Add a check-in

  1. Open Job check-ins in the menu and click Add a check-in.
  2. Give it a Name, such as "Nightly database backup".
  3. Under When does the job run?, choose Every so often (for example every 1 day) or On a cron schedule. For a cron schedule, paste the same time part as in your crontab, such as 30 2 * * *, and pick the Time zone of the schedule. That's usually the server's time zone: run timedatectl on the server to see it.
  4. Set the Grace time: how long to wait after the expected time before you get an alert. Make it longer than the job takes. The default is 30 minutes.
  5. Pick the Server if you like. It only shows where the job runs.
  6. Click Add check-in.

Copy the address now. It is shown only once. Anyone with it can check in for this job, so keep it like a password. If you lose it, open the check-in and click Make a new address. The old one stops working at once.

Call the address from your job

The simplest way: call the address when the job ends well.

0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 -o /dev/null https://app.servernest.io/api/v1/hooks/ping/YOUR-SECRET

You can tell ServerNest more:

  • Add /start when the job begins, to see how long it takes.
  • Add /fail when it fails, to get an alert straight away.
  • Or add the exit code, such as /0 for success or /1 for a failure.
  • Send the job's output with a POST request to see it next to each run. The last 10 KB is kept.

The check-in page shows these examples with your own address filled in.

What the status means

  • Waiting for first call: nothing is checked until the job calls once.
  • On time: the last call came when expected.
  • Late: past the expected time, but still inside the grace time. No alert yet.
  • Missed: past the grace time. You got an alert.
  • Failed: the last run said it failed. You got an alert.

Alerts

You get one alert when a job is missed or fails, and a note when it works again. Missed and failed jobs are urgent alerts, so they reach you on every plan: on the Notifications page, by email (if your email choice allows it) and in your Slack, Discord, Telegram or webhook channels. See monitoring and alerts.

History

Open a check-in to see its Last runs: when, the result, how long it took and the output. The last 100 calls from the last 30 days are kept.

Good to know

  • Everyone on the team can see check-ins. Owners, admins and developers can add, change and remove them.
  • Check-ins are separate from the cron jobs you add to an app. They don't count toward the cron job limit on your plan.
  • Pausing a check-in isn't possible yet. Remove it and add it again later.

Related: cron job not running?, real cron for WordPress, back up and restore. Which plans include this: pricing.

← All guides