In a normal production webiste, there are many tasks that need to be done via crontab, but lets say you dont want all of these tasks to run on every cron.
For example, i would love to have:
- A cron that run once a day, for the 'normal' maintenance (updates checks, for example)
- B cron that runs every 15 minutes, to send newsletters (from simplenews)
- C cron that run twice a day, that pull data from a view (json view) and write down a json file on the server (for a geomapping service with lots of data that doenst need a real-time sincronyzation).
Actually, i have a unique cron that do the A, B and C tasks on every run, every 15 minutes; so i created 2 php scripts that bootstrap drupal, one send the emails, and the other one cache the geomapping file.. it works, but is pretty a manual way that i dont like too much.
What is the best practice to set different crons, get all the modules hook_cron, and assign them only to a specific cron?