had this bizarre issue where a backup script ran fine monday through friday but failed every saturday. took me way too long to figure out.

turns out the script was calling an internal API that had rate limiting. during the week, the backup ran at 2am when nobody was using the system. on saturdays, some other batch process kicked off at the same time and ate up all the API quota.

the fix was dead simple — stagger the start time by 30 minutes. but finding the cause? that was a couple hours of my life I'm not getting back.

moral of the story: if your cron job is failing intermittently, check what else runs at the same time. crontab -l only shows YOUR crontab. other users and system crontabs in /etc/cron.d/ might be competing for the same resources.

all 9 comments

sorted by: hot top controversial new old
[–] 34 points 6 hours ago (2 children)

I'll take this opportunity to share a classic: https://beza1e1.tuxen.de/lore/high_tide.html

"Its high tide!"

Which was met with blank looks and probably a wavering hand over the intercom to Security.

"It stops working at high tide"

  • source
  • hideshow 2 child comments
  • [–] 20 points 4 hours ago

    Can't send mails to destinations too far away? https://web.mit.edu/jemorris/humor/500-miles

  • source
  • [–] 16 points 6 hours ago
    [–] 7 points 3 hours ago

    I have a cron job that has been failing since I added it. I'll get around to fixing it at some point.

  • source
  • [–] 4 points 5 hours ago

    Loved the replies. Once it’s over (that’s the hard part), everyone has a funny story to tell!

    Mine was a race condition in an outsourced core system that showed up about six months after release, only when enough transactions hit at the same moment. The contact centre was on fire, with people calling non-stop.

    Same lesson as yours: when something fails only sometimes, stop staring at the code and look at what else is running at that moment.

  • source
  • [–] 4 points 5 hours ago

    That's why I uses systemd timers with RandomizeDelay. Spreads the load a but

  • source
  • [–] 2 points 1 hour ago

    good advice, good job.

  • source