atifaziz / NCrontab

Crontab for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any Operator Support

elksson opened this issue · comments

For some reason I cannot get this ? (Any Operator) to work.

Is there a way to create the following cron using NCronTab?

? ?/15 7-22 * * *

At ? seconds past the minute, every 15 minutes, starting at ? minutes past the hour, between 07:00 AM and 10:59 PM

NCrontab doesn't claim to support ? in any of the fields of the expression (see Crontab Expression) so it's not surprising you can't get it to work.

How would one start to add this support?

How would one start to add this support?

I'm not sure at which level you're asking this. Do you mean how to add support to this project via a PR or are you looking for guidance at the code level in your own private fork?

Either way, there is no standard definition of ?. For example, the CRON expression section of the Wikipedia article on Cron says this:

Question mark (?)

In some implementations, used instead of '*' for leaving either day-of-month or day-of-week blank. Other cron implementations substitute "?" with the start-up time of the cron daemon, so that ? ? * * * * would be updated to 25 8 * * * * if cron started-up on 8:25am, and would run at this time every day until restarted again.

I would like direction on how I would fork the project to add support so that ? would use the time the cron expression started. Then after I have implemented I would like to make a pull request to bring it back into the project.