<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lotus Li</title>
    <description>The latest articles on DEV Community by Lotus Li (@gcesoftware).</description>
    <link>https://dev.to/gcesoftware</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4128790%2F7a061383-4588-48f7-a951-293138eaafd4.png</url>
      <title>DEV Community: Lotus Li</title>
      <link>https://dev.to/gcesoftware</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gcesoftware"/>
    <language>en</language>
    <item>
      <title>How to Monitor Cron Jobs with a Simple HTTP Health Check</title>
      <dc:creator>Lotus Li</dc:creator>
      <pubDate>Sun, 20 Sep 2026 21:14:59 +0000</pubDate>
      <link>https://dev.to/gcesoftware/how-to-monitor-cron-jobs-with-a-simple-http-health-check-55jb</link>
      <guid>https://dev.to/gcesoftware/how-to-monitor-cron-jobs-with-a-simple-http-health-check-55jb</guid>
      <description>&lt;h1&gt;
  
  
  How to Monitor Cron Jobs with a Simple HTTP Health Check
&lt;/h1&gt;

&lt;p&gt;Cron jobs are great for automating repetitive tasks, but there is one problem:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens when the job stops running?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A cron entry can exist for months without anyone noticing that the script has started failing.&lt;/p&gt;

&lt;p&gt;For example, you might have a backup job running every night:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;0 2 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; /path/to/backup.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;Everything looks fine until the backup silently fails.&lt;/p&gt;

&lt;p&gt;One simple way to solve this is to make the job send an HTTP request whenever it completes successfully.&lt;/p&gt;

&lt;p&gt;## The basic idea&lt;/p&gt;

&lt;p&gt;Instead of only running the job, make it report that it is alive:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
0 2 * * * /path/to/backup.sh &amp;amp;&amp;amp; curl https://ping.doyouok.com/ping/YOUR-API-KEY&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;plaintext&lt;/p&gt;

&lt;p&gt;The monitoring service records the check-in.&lt;/p&gt;

&lt;p&gt;If the expected check-in doesn't arrive within the configured interval, you receive an alert.&lt;/p&gt;

&lt;p&gt;This creates a simple "dead man's switch" for your scheduled jobs.&lt;/p&gt;

&lt;p&gt;## Why HTTP check-ins work well&lt;/p&gt;

&lt;p&gt;There is no agent to install and no special monitoring software required on the server.&lt;/p&gt;

&lt;p&gt;Your existing script simply makes an HTTP request after a successful run.&lt;/p&gt;

&lt;p&gt;This approach can work for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux cron jobs

&lt;ul&gt;
&lt;li&gt;Windows scheduled tasks&lt;/li&gt;
&lt;li&gt;Database backups&lt;/li&gt;
&lt;li&gt;Import/export jobs&lt;/li&gt;
&lt;li&gt;Background scripts&lt;/li&gt;
&lt;li&gt;Data processing jobs&lt;/li&gt;
&lt;li&gt;n8n workflows&lt;/li&gt;
&lt;li&gt;Make scenarios&lt;/li&gt;
&lt;li&gt;Zapier automations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important part is that the process reports success.&lt;/p&gt;

&lt;p&gt;## Example with a shell script&lt;/p&gt;

&lt;p&gt;You can also keep the monitoring logic inside your script:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;

&lt;h1&gt;
  
  
  !/bin/bash
&lt;/h1&gt;

&lt;p&gt;/path/to/backup.sh&lt;/p&gt;

&lt;p&gt;if [ $? -eq 0 ]; then&lt;br&gt;
    curl -fsS &lt;a href="https://ping.doyouok.com/ping/YOUR-API-KEY" rel="noopener noreferrer"&gt;https://ping.doyouok.com/ping/YOUR-API-KEY&lt;/a&gt;&lt;br&gt;
fi&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now the monitoring request is only sent when the backup succeeds.&lt;/p&gt;

&lt;p&gt;If the script fails, there is no check-in.&lt;/p&gt;

&lt;p&gt;If there is no check-in within the expected time, the monitor can alert you.&lt;/p&gt;

&lt;p&gt;## Monitoring more than cron&lt;/p&gt;

&lt;p&gt;The same pattern is useful for other automated processes.&lt;/p&gt;

&lt;p&gt;For example, a scheduled database export might finish successfully every six hours. Instead of trying to inspect the server manually, the export process can simply check in when it completes.&lt;/p&gt;

&lt;p&gt;The same idea can also be used with automation platforms such as n8n, Make, and Zapier.&lt;/p&gt;

&lt;p&gt;You don't necessarily need a complicated monitoring stack for a simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Did this process run successfully?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;## I built Doyouok for this&lt;/p&gt;

&lt;p&gt;I've been working on &lt;a href="https://doyouok.com/" rel="noopener noreferrer"&gt;Doyouok&lt;/a&gt; to provide simple monitoring for processes that should keep running.&lt;/p&gt;

&lt;p&gt;It uses HTTP check-ins and alerts when an expected check-in is missed.&lt;/p&gt;

&lt;p&gt;There is nothing to install on the machine running the job.&lt;/p&gt;

&lt;p&gt;You can start with the free plan and create checks for your own cron jobs, scheduled tasks, scripts, backups, and automation workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Doyouok:&lt;/strong&gt; &lt;a href="https://doyouok.com/" rel="noopener noreferrer"&gt;https://doyouok.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;## Final thought&lt;/p&gt;

&lt;p&gt;For many scheduled jobs, monitoring doesn't need to be complicated.&lt;/p&gt;

&lt;p&gt;A simple successful HTTP check-in can answer an important question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Is this job still running?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the answer suddenly becomes "no", that's when you want to know about it — not several days later when you discover that your backups or automation have stopped.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cron</category>
      <category>monitoring</category>
    </item>
  </channel>
</rss>
