Linux – Are Linux cron Jobs each executed sequentially or in parallel

cronlinux

Lets say I create two cron jobs:

  • Cron Job A, runs every day at 8:00AM
  • Cron Job B, runs every day at 8:05AM

However, Cron Job A, takes 12 hours to run (don't ask why, this is an example).

Will Cron Job B get to run at 8:05AM or do cron jobs only get executed one at a time?

If a Cron Job that was previously running was interrupted by a System Restart/Reboot, will it resume/run again after subsequent boot?

Best Answer

Yes, cron job B will run at 8:05. You can also run more than one long-running job at 8:00 etc.

However, the job will not resume after a reboot. If you need something like that rewrite your job with a wrapper that gets scheduled often and that checks if it has something new to do or something else to continue. This will depend on the task you want to do, obviously.

Related Topic