Cronjob execution time 5min vs 15min

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

In the file cron.php https://github.com/nextcloud/server/blob/89710bbdcf37ec92851adb68bd3af69a5c402f4a/cron.php#L117 I saw, that once a cron job has been triggered, we will execute the background jobs for 14 minutes. In the documentation https://docs.nextcloud.com/server/18/admin_manual/configuration_server/background_jobs_configuration.html#systemd 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
Georg

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”.
Thanks

1 Like