Question

ChatGPT wrote a cron job that runs 60 times a minute instead of once an hour

Solved · 7 views · asked by kai_makes · edited

* * * * * instead of 0 * * * *. Found out from the bill.

What I’ve tried

Fixed the expression to 0 * * * *. Now I want a way to catch the next mistake before it costs money.

Comment

1 answer

Marked as helpful by the asker
jonas_k · edited

Paste every cron expression into crontab.guru before you deploy it; it tells you in English what it does. And put a guard in the job itself: skip if the last run was less than 50 minutes ago. Then a wrong schedule costs one run, not a thousand.

Comment