Cron – Can a Crontab Job Run Concurrently with Itself?

cron

If I have a crontab job that runs, for instance, every hour, but that job may take more than an hour to complete, will the next job fail to run?

Best Answer

No, cron scripts run parallelly, if you do not implement some locking mechanism.

See Quick-and-dirty way to ensure only one instance of a shell script is running at a time and Correct locking in shell scripts? for possible solutions.

A simpler way is to use lockfile, like in this answer or the run-one package (see this answer) - thanks to gertvdijk for suggesting it.

Related Question