Create and run several jobs at different time

Created on 30 March 2018, about 7 years ago
Updated 8 January 2025, 4 months ago

First some explanation of my Drupal environment. This website has a lot of functionality used in a factory production environment. I have one particular function where I need cron.

Several companies use this system. Each company can keep track of fysical jobs that are processed by their employees. Employees use a barcode scanner to start and stop their jobs in the system. Sometimes they forget to stop their job at the end of the day. The factory can set a checktime for open jobs and a stoptime all open jobs need to be set on at the checktime. Those time values are different for each factory.

I like to set a cronjob for each factory. I could use hook_cron and loop through all the companies, but the cron for each company may only run once a day. I tried to loop through each company and create a cronjob hook_cron_api for each company, but I can't get the callback can't be found. Could I create several cronjobs with their one run time and how do I do that? Another optin would be to use a flag per company that is set on cron run and reset at 0:00?

Cronjob schedule for checktimes could look like this:
company 1: 30 23 * * *
company 2: 0 23 * * *

Can someone help me out to the right strategy? Thanks very much.

Edit:
So I guess the question is how to create an individual cronjob every time a company sets or changes the time settings?

💬 Support request
Status

Closed: outdated

Version

2.6

Component

Code

Created by

🇳🇱Netherlands HansKuiters

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark arnested

    I'm closing this since Drupal 7 is now unsupported and there will be no more development on the Drupal 7 branch of Ultimate Cron either.

    Thank you for taking the time and effort in reporting this issue, even though it never got resolved.

Production build 0.71.5 2024