More Dynamic Cronjobs

18 points | by 0928374082 2 hours ago

3 comments

  • WolfCop 5 minutes ago

    Does anyone maintain a programmatically accessible list of holidays for their company? Similar to the HOLIDAYS.txt in the article, but it would allow for things like “don’t run this the day before or during a company holiday.”

    I work at a company with different holidays in certain countries, which would complicate things, and require something more structured than an implementing dates. But having that accessible could be useful.

    Has anyone tackled that, or come across a solution?

  • victorbjorklund an hour ago

    Cool. Had no idea you could run commands inside a CRON expression.

      garganzol 30 minutes ago

      Running a command is the main idea of cron. In this case, the author runs composite commands like:

          test && action
      
      Where 'test' is another shell command that returns 0 or 1. This is not a special cron syntax, it's just the inherent capability of the Unix shell.

      In any case, this whole approach is very clever and shows the beauty of The Unix Way.