How do you model the "recurring task" database?

I wonder what is the best way to model the task management? Let’s say we have task(id,title,startdate,enddate…) and we also have recurring tasks which could be daily, weekly,monthly and these recurring tasks happens in a period of time?

are you sure that daily, weekly, monthly are the ~only~ recurrences you want to model?

what about every second tuesday? the fourth thursday of every month? etc.

I think that complicated enough I think I need to model. I am trying to find the best models in terms of performance when I retrieve the data. Thanks!

To me it doesn’t seem a database problem. The easy thing is to store the tasks (and i would be generic for that purpose, perhaps use crontab as example); the complicated issue is to design the process which will coordinate the tasks. This process has to know when to start a new task, ideally by sleeping in between tasks instead of polling the database.