

What I Wish Some Had Told Me About Writing Cron Jobs - gpapilion
http://blog.hypergeometric.com/2012/07/18/what-i-wish-some-had-told-me-about-writing-cron-jobs/

======
Ralith
If it matters that your cron jobs not run simultaneously, you need to use a
mechanism that actually ensures that. This is not getting "more complicate,"
this is the absolute basics of effective concurrency. Your example will fail
if two jobs perform that test simultaneously, because neither will have
created the file when the check is made. Not to mention the chaos that will
ensue when your system shuts down or crashes while one or more jobs are in
progress...

~~~
gpapilion
Generally cron will launch two jobs in that time period. However you make a
good point. If you need that level of concurrency protection cron isn't the
right solution.

~~~
Ralith
Not at all. It's completely feasible to perform mutual exclusion in a cron
script, just as it's completely feasible to make the same error you did in C.
It's got next to nothing to do with the environment.

