Read more

Your Cronjobs should not rely on a perfect schedule

Henning Koch
August 07, 2014Software engineer at makandra GmbH

Due to network or hardware failures, it can happen that one of your cronjobs will not run at the time you specify in the schedule. Your code should be built in a way that it can be re-run at a later time (when the failure is resolved).

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

For example, if you are synchronizing data with another service once every day, your cronjob should not only synchronize changes from the last 24 hours. If you do this and a network failure will delay the execution of your job by 5 hours, you will only synchronize changes from hour 6-29, but forget changes from hour 1-4.

Instead your cronjob should remember the last time a sync was performed successfully, and sync all the changes that happened after that.

Posted by Henning Koch to makandra dev (2014-08-07 09:35)