Cronjob execution time 5min vs 15min

I’m playing around a bit with nextcloud and image preview generation. Now I stumbled across the cron jobs.

In the file cron.php I saw, that once a cron job has been triggered, we will execute the background jobs for 14 minutes. In the documentation it is mentioned, to configure the cron job to start every 5 minutes. This would mean, that if we have a long running cron job, we would have multiple cron jobs run in parallel. Is this the correct behavior or should the documentation be adapted, so that the nextcloudcron.timer runs every 15 minutes?

Best regards

That’s exactly what the comment above the line you’ve linked tells:

// We only ask for jobs for 14 minutes, because after 5 minutes the next
// system cron task should spawn and we want to have at most three
// cron jobs running in parallel.

After 14 minutes, cron gets killed (see line 135).

Ah sorry, seems like I didn’t read the comment properly…
So in the end, we could have “at most three cron jobs running in parallel”.

1 Like