Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cron job running beyond interval

Tags:

cron

Say you configure a cron job to run every minute to do something. What will happen if the actual task runs longer than a minute? Will cron create another job instance/thread? Or will cron wait and make sure the previous run is complete?

Thanks!

like image 745
user2092070 Avatar asked Nov 12 '22 11:11

user2092070


1 Answers

You must handle that scenario, not sure linux will handle it gracefully. By adding a simple check before running your task that the task is not already running. If you don't do that, hell will probably break loose on your server.

This post will help you Run cron job only if it isn't already running

like image 148
legrandviking Avatar answered Dec 28 '22 01:12

legrandviking