With Cronitor you can create and integrate a cron job monitor in minutes, no coding required. When you create a monitor with a rule like
Not on Schedule */15 * * * 1-5
we will alert you of any noncompliance with the schedule, including:
Monitoring your cron job is easy:
Your new monitor is created in a paused state; monitoring will not begin until the first ping is received.
It's great to know that your cron job started but it's really valuable to know that it completed successfully. To alert you as quickly as possible when that's not the case we've developed a duration prediction algorithm. The predictions grow more accurate as we learn more about your job performance but will not work perfectly for every job. If it's normal for job runtime to vary significantly, or if you are receiving has not completed alerts earlier than you would like, you can provide a fixed runtime duration:
To send duration alerts, Cronitor must know when your job starts running and when it completes successfully. To
report these events, you should ping your
/run endpoint as your job starts and
as it exits successfully. For more details on ping URL endpoints and where you should integrate your ping requests,
A cron job running before the last occurrence completes is a common problem, especially in jobs that run frequently. A few seconds of overlap may be harmless, but a pile-up of jobs can take down your server. Cronitor will alert you if your job does not terminate before running again.
grace_secondson your not_on_schedule rule.
/runendpoint before your job and your
/completeendpoint after. A missing or misplaced
/completeping is the most common integration mistake.
datecommand on your linux server or
tzutil /gon windows you can verify that your server time matches the timezone set in your account settings.
If you've verified that you're pinging
/complete endpoints appropriately, try changing the logic in your
&& "and" logic to
; "or" logic.
Switch from only pinging
/complete if your command finishes successfully:
* */2 * * * curl -m 10 https://cronitor.link/d3x0/run ; /path/to/db_backup.sh && curl -m 10 https://cronitor.link/d3x0/complete
To always pinging your
* */2 * * * curl -m 10 https://cronitor.link/d3x0/run ; /path/to/db_backup.sh ; curl -m 10 https://cronitor.link/d3x0/complete
By changing to
; you will ping your Cronitor URL even if your command exits with a non-zero
exit code. If this works, you should investigate why your command is exiting with an error code.