<?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: lumm</title>
    <description>The latest articles on DEV Community by lumm (@lumm_7b4812001a80f4b531cf).</description>
    <link>https://dev.to/lumm_7b4812001a80f4b531cf</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3385512%2Fb8d7f1b7-7cd4-4474-8c67-7fd9256ac452.png</url>
      <title>DEV Community: lumm</title>
      <link>https://dev.to/lumm_7b4812001a80f4b531cf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lumm_7b4812001a80f4b531cf"/>
    <language>en</language>
    <item>
      <title>7 cron expression gotchas that will silently break your scheduled jobs</title>
      <dc:creator>lumm</dc:creator>
      <pubDate>Thu, 21 May 2026 03:40:21 +0000</pubDate>
      <link>https://dev.to/lumm_7b4812001a80f4b531cf/7-cron-expression-gotchas-that-will-silently-break-your-scheduled-jobs-5f6a</link>
      <guid>https://dev.to/lumm_7b4812001a80f4b531cf/7-cron-expression-gotchas-that-will-silently-break-your-scheduled-jobs-5f6a</guid>
      <description>&lt;p&gt;I've been working with cron expressions across different platforms for a while now, and I keep running into the same traps — some of them cost me hours of debugging, one of them cost me a full day of missed backups.&lt;/p&gt;

&lt;p&gt;Here are 7 gotchas I've collected, with fixes for each.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. "Every 6 hours" vs "every minute of hour 6"
&lt;/h2&gt;

&lt;p&gt;This is the classic. You write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 6 * * *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thinking it means "every 6 hours." It doesn't. It means "at 06:00 every day." What you actually want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 */6 * * *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;*/6&lt;/code&gt; in the hour field means "every 6th hour." Without the slash, you're just picking hour 6.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. GitHub Actions is UTC-only and lies about timing
&lt;/h2&gt;

&lt;p&gt;Your workflow says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cron&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;9&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;1-5'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You think it runs at 9am your time. It runs at 9am UTC. If you're in US Eastern, that's 5am. If you're in Beijing, that's 5pm.&lt;/p&gt;

&lt;p&gt;Worse: GitHub Actions can delay scheduled runs by 5-30 minutes under heavy load. A job scheduled for 9:00 UTC might actually fire at 9:22. This matters if you have downstream dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;code&gt;*/5&lt;/code&gt; doesn't work on AWS EventBridge
&lt;/h2&gt;

&lt;p&gt;You write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cron(*/5 * * * ? *)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;EventBridge rejects it. AWS uses &lt;code&gt;0/5&lt;/code&gt; instead of &lt;code&gt;*/5&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cron(0/5 * * * ? *)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No error message tells you this clearly. You just get a generic validation failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Day-of-month + day-of-week: OR vs AND
&lt;/h2&gt;

&lt;p&gt;This one is genuinely confusing. The expression:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 8 15 * 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On &lt;strong&gt;Linux cron&lt;/strong&gt;: fires on the 15th of every month &lt;strong&gt;OR&lt;/strong&gt; every Monday. (OR semantics)&lt;/p&gt;

&lt;p&gt;On &lt;strong&gt;AWS EventBridge / Quartz&lt;/strong&gt;: you can't even set both — one field must be &lt;code&gt;?&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you want "the first Monday of every month" on Linux, you need a shell guard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;0 8 1-7 &lt;span class="k"&gt;*&lt;/span&gt; 1 &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +&lt;span class="se"&gt;\%&lt;/span&gt;u&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="nt"&gt;-eq&lt;/span&gt; 1 &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; /your/command
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Vercel Hobby plan: 1 cron job per day
&lt;/h2&gt;

&lt;p&gt;You deploy a Vercel cron that runs every hour:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"crons"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/api/cleanup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"schedule"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0 * * * *"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the Hobby plan, this silently gets throttled to once per day. No warning in the build output. You find out when your cleanup hasn't run for 23 hours.&lt;/p&gt;

&lt;p&gt;Pro plan minimum interval is 1 minute. Hobby is 1 per day. Period.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Kubernetes timeZone field needs v1.27+
&lt;/h2&gt;

&lt;p&gt;You add this to your CronJob spec:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;timeZone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;America/New_York"&lt;/span&gt;
  &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;9&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On clusters older than 1.27, the &lt;code&gt;timeZone&lt;/code&gt; field is silently ignored. Your job runs in UTC. No error, no warning.&lt;/p&gt;

&lt;p&gt;Always check your cluster version before relying on this field.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Quartz uses different weekday numbers
&lt;/h2&gt;

&lt;p&gt;Linux cron: &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;7&lt;/code&gt; = Sunday, &lt;code&gt;1&lt;/code&gt; = Monday&lt;/p&gt;

&lt;p&gt;Quartz: &lt;code&gt;1&lt;/code&gt; = Sunday, &lt;code&gt;2&lt;/code&gt; = Monday&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;0 8 ? * 2&lt;/code&gt; means Monday on Quartz but Tuesday on Linux. Copy-paste between platforms and you've shifted your entire schedule by a day.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I built a tool for this
&lt;/h2&gt;

&lt;p&gt;After hitting most of these myself, I built &lt;a href="https://cronwiz.dev" rel="noopener noreferrer"&gt;cronwiz.dev&lt;/a&gt; — type a schedule in plain English, get the cron expression for 7 platforms (Linux, AWS, K8s, GitHub Actions, Vercel, Quartz, Cloudflare Workers) with platform-specific warnings baked in.&lt;/p&gt;

&lt;p&gt;It also works in reverse: paste a cron expression and get a human-readable explanation. Useful when you're debugging someone else's crontab at 3am.&lt;/p&gt;

&lt;p&gt;Free, no signup. The &lt;a href="https://github.com/lumm256/cronwiz" rel="noopener noreferrer"&gt;source is on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'm also building a cron monitor (dead-man's-switch style — your job pings a URL on success, you get alerted if it doesn't fire on time). Waitlist is on the site if that's interesting.&lt;/p&gt;




&lt;p&gt;What cron gotchas have bitten you? I'm always looking for more edge cases to add to the tool.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>showdev</category>
      <category>saas</category>
      <category>monitoring</category>
    </item>
  </channel>
</rss>
