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.

  • Jayjader@jlai.lu
    link
    fedilink
    arrow-up
    1
    ·
    35 minutes ago

    I was just reading an article today about how now that there’s more and more uninterruptible power supplies plugged into the grid, notably with all the data centers that were built over the last 20 years, the grid itself experiences a similar disturbance ever minute as all the factory-default-configured systems pulse to check their internal battery state.

    The article concluded with “the simplest fix would be to stagger/randomize the default check times, but how can we encourage manufacturers to do so?”